traced

Wraps this provider's main, io and default dispatchers in TracingDispatchers labeled "main", "io" and "default" that report to sink. unconfined is returned as is.

Diagnostic tool, opt-in. See TracingDispatcher for what is and is not observed.

Example:

val dispatchers = DefaultDispatcherProvider.traced(RingBufferSink(256))
val repo = UserRepository(dispatchers)

Requires opting in to ExperimentalStructuredCoroutines.

Receiver

the provider whose dispatchers are wrapped.

Return

a provider that traces main, io and default.

Parameters

sink

receiver of the trace events.

See also