PlatformThreadContextElement



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

Summary

Public properties

open String

The category that a trace section belongs to.

Cmn
open List<Long>

The underlying Perfetto flow ids that can be used to determine the causality for a given trace section.

Cmn
open String

The name of the code section as it appears in a trace.

Cmn
open T

The Tracer instance that can use this PropagationToken for context propagation when the coroutine suspends and resumes.

Cmn

Inherited functions

From kotlin.AutoCloseable
abstract Unit
Cmn
From kotlin.coroutines.CoroutineContext
open operator CoroutineContext
Cmn
From kotlin.coroutines.CoroutineContext.Element
open R
<R : Any?> fold(initial: R, operation: (CoroutineContext.Element, R) -> R)
Cmn
open operator E?
Cmn
open CoroutineContext
Cmn

Public functions

contextElementOrNull

@DelicateTracingApi
open fun contextElementOrNull(): CoroutineContext.Element?
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.

Public properties

category

open var categoryString

The category that a trace section belongs to.

flowIds

open val flowIdsList<Long>

The underlying Perfetto flow ids that can be used to determine the causality for a given trace section.

name

open var nameString

The name of the code section as it appears in a trace.

tracer

open val tracer: T

The Tracer instance that can use this PropagationToken for context propagation when the coroutine suspends and resumes.