Be able to specify Token for Dispatcher and Invoker
During the invoke procedure for a worklet, the Dispatcher
internally creates a Token
object that is scoped during the call of the Invoke
. Any parameters passed into the invoke get "locked" while the worklet is being executed. This prevents a separate Invoke
trying to use the same data and cause unpredictable changes.
There may be instances where you want to override this behavior so that to running worklets can simultaneously write to the same array (or one write while the other is still reading). To enable this behavior, the Dispatcher
s need to share the same Token
. There should be a way to specify the Token
to use for a Dispatcher
. Likewise, you should be able to specify a Token
for an Invoker
that gets given to all Dispatcher
s it calls. (Or perhaps just have a flag that the Invoker
passes an internal Token
to the Dispatcher
.)