Skip to content

SentierContext

Stores the current task into the CoroutineContext of a coroutine.

Configuration

To be able to use Sentier functions in a coroutine, the coroutine must own a span.

val rootSpan = Sentier.yourSentierImplementation().createRootSpan {}
withContext(rootSpan.asCoroutineContext()) {
    // Here, you can use coroutine Sentier functions
}

Types

Companion

Properties

key

open override val key: CoroutineContext.Key<*>

span

val span: Span

Functions

fold

open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R

get

open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?

minusKey

open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext

plus

open operator fun plus(context: CoroutineContext): CoroutineContext