This enhancement intends to refine PropagationContextElement
by:
- Capturing the ThreadLocal
when instantiating the PropagationContextElement
in order to support dispatchers switching threads
- Removing the constructor parameter which is not idiomatic and breaks the support when switching threads, and use instead the updateThreadContext(context: CoroutineContext)
parameter
- Making the kotlinx-coroutines-reactor
dependency optional
- Making the properties private
- Documentation the recommended usage as Dispatchers.IO + PropagationContextElement()
cc @bclozel