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

Better modularization of async container's context #4

Open
JoaaoVerona opened this issue May 14, 2016 · 1 comment
Open

Better modularization of async container's context #4

JoaaoVerona opened this issue May 14, 2016 · 1 comment
Assignees
Labels

Comments

@JoaaoVerona
Copy link
Owner

JoaaoVerona commented May 14, 2016

Right now, when AsyncContainers are created, they receive an unique, fresh context, which have as it's parent the context where the async is being created.
For example, the script...

i = 0
j = 5

async {
  i = 1000
}

sleep(50)
println(i)

... will print 1000, because the async container have full access to the main context, thus changes to variables will also be reflected in any other component which also access the main context.

A proposal for modularization of async container's context is defined as:

  • continue giving them an unique, new context
  • creating a copy of the current parent context, and attributing it as the new context's parent

This way, the async container can access any variables on the parent context, but their values will be calculated once (it is: at the time the async container starts). Therefore, any changes made by the async container will NOT be reflected outside it, since the parent context was COPIED and not directly referenced.

@JoaaoVerona JoaaoVerona changed the title Modularize better the context of async containers Better modularization of async container's context May 14, 2016
@JoaaoVerona
Copy link
Owner Author

This issue will NOT be implemented until #8 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant