Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace management #443

Open
JohnCoene opened this issue Oct 25, 2024 · 2 comments
Open

Workspace management #443

JohnCoene opened this issue Oct 25, 2024 · 2 comments
Labels
critical question Further information is requested

Comments

@JohnCoene
Copy link
Member

Labeling this as question, it came to mind yesterday.

By default blockr uses one workspace object which I believe will cause issues if we have multiple concurrent users as they will be referencing the same workspace environment. I think that's bound to leads to data races and other issues.

Each user should have their own workspace I think.

Is there an easy way to define that when the application starts up?

@JohnCoene JohnCoene added question Further information is requested critical labels Oct 25, 2024
@nbenn
Copy link
Collaborator

nbenn commented Oct 28, 2024

In principle, I believe this can be handled with what we have currently: all "workspace manipulating" functions (should) have a workspace arg. What is expected there is an environment created as

blockr/R/workspace.R

Lines 43 to 48 in 061ac78

workspace_env <- structure(
new.env(parent = emptyenv()),
title = "",
settings = list(),
class = "workspace"
)

Happy to export a ctor for this, something like

new_workspace <- function(env = new.env(parent = emptyenv()), title = "", settings = list()) {
  structure(
    env,
    title = title,
    settings = settings,
    class = "workspace"
  )
}

And with that we'd be good to go (for now at least), no?

As discussed elsewhere, I believe the whole "workspace" approach taken should be reconsidered...

@nbenn
Copy link
Collaborator

nbenn commented Oct 28, 2024

The current result_field implementation is not compatible with "multiple" workspaces, as it goes and fetches stack results from the default. This will change with #432 however as it does not work as intended anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants