You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
JoaaoVerona
changed the title
Modularize better the context of async containers
Better modularization of async container's context
May 14, 2016
Right now, when
AsyncContainer
s 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...
... 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:
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.
The text was updated successfully, but these errors were encountered: