Skip to content

Conversation

@sjorsdonkers
Copy link
Contributor

@sjorsdonkers sjorsdonkers commented Apr 25, 2025

Instead of maintaining a scop in Env, Executor and for a Page we enter and exit a scope upon receiving a call or a command.
The problem is that an Isolate has only 1 scope stack, but we have multiple contexts in flight at the same time.
This caused a problem where a page would close the scope, which would also remove the context that the isolatedworld put in there.

By closing all the scopes on exit of a command or call this should not be an issue.
Instead of storing globals in the Env scope, they are now persisted.
Also the context itself needs to persist, so we need to manually reset it when the context is deleted.

pub fn deinit(self: *Self) void {
if (self.isolated_world) |isolated_world| {
isolated_world.executor.endScope();
isolated_world.executor.context.enter();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO cleanup

@sjorsdonkers
Copy link
Contributor Author

PR closed in favor of #578
May need to reevaluate when we have multiple worlds.
Some of the persistence change have been adopted in 578

@sjorsdonkers sjorsdonkers deleted the noscope branch April 29, 2025 13:45
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants