Plain Java ThreadLocals can't be used with non-blocking tasks, since tasks may execute their continuation on a different thread. An idea would be to extend Scala's DynamicVariable such that it can be used together with execution contexts to provide a safe alternative suitable for non-blocking tasks.
Plain Java ThreadLocals can't be used with non-blocking tasks, since tasks may execute their continuation on a different thread. An idea would be to extend Scala's DynamicVariable such that it can be used together with execution contexts to provide a safe alternative suitable for non-blocking tasks.