PropagationToken


public interface PropagationToken

Known direct subclasses
PlatformThreadContextElement

We use the PlatformThreadContextElement construct to know when a coroutine has suspended, and about to resume on a Thread.

PropagationUnsupportedToken

The PropagationToken instance that should be returned when context propagation is unsupported by the underlying Tracer.


A token representing state carried forward for context propagation.

This interface is only useful for libraries that want to bring their own implementation of context propagation.

Summary

Public methods

contextElementOrNull

Added in 2.0.0-alpha01
@DelicateTracingApi
abstract CoroutineContext.Element contextElementOrNull()
Returns
CoroutineContext.Element

a CoroutineContext.Element that needs to be installed in the kotlinx.coroutines.currentCoroutineContext prior to dispatching the suspending block of code being traced; if the token is being used in a suspending context.