context-propagation icon indicating copy to clipboard operation
context-propagation copied to clipboard

Support Kotlin coroutines

Open sjoerdtalsma opened this issue 6 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Kotlin coroutines are stored in memory and have their own contexts and can be scheduled to resume on different threads.

ThreadLocal contexts won't work with coroutines out of the box.

Describe the solution you'd like

Support coroutines similar to the solution that was created for Slf4J MDC context: kotlinx-coroutines-slf4j

Describe alternatives you've considered

Additional context

  • Documentation: https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/coroutine-context-and-dispatchers.md#thread-local-data

sjoerdtalsma avatar Jul 09 '19 13:07 sjoerdtalsma

See https://github.com/Kotlin/kotlinx.coroutines/issues/119

sjoerdtalsma avatar Jul 09 '19 13:07 sjoerdtalsma

this might help https://github.com/openzipkin/brave/issues/820#issuecomment-447614394

codefromthecrypt avatar Jul 09 '19 13:07 codefromthecrypt

As I don't use Kotlin in production at this moment, I feel I would not be able to provide reasonable usecases for the tests to write.

sjoerdtalsma avatar Dec 24 '19 09:12 sjoerdtalsma