Skip to content

Instantly share code, notes, and snippets.

@RBusarow
Last active July 22, 2019 13:27
Show Gist options
  • Save RBusarow/ec38e02ebf8062fa4c25c65cbddef8b8 to your computer and use it in GitHub Desktop.
Save RBusarow/ec38e02ebf8062fa4c25c65cbddef8b8 to your computer and use it in GitHub Desktop.
extracting Elements from a CoroutineContext
fun lookForCoroutineContextElements(context: CoroutineContext) {
val job: CoroutineContext? = context[Job]
val interceptor: CoroutineContext? = context[ContinuationInterceptor]
val exceptionHandler: CoroutineContext? = context[CoroutineExceptionHandler]
val name: CoroutineContext? = context[CoroutineName]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment