TraceEncoder
constructor(scope: CoroutineScope, start: TimeMark = TraceEncoderTimeMark, ioDispatcher: CoroutineDispatcher = IO, sinkProvider: () -> BufferedSink)(source)
Parameters
scope
The CoroutineScope that defines the lifetime for the encoder. When the scope is cancelled or fails, the sink returned from sinkProvider will be closed.
start
The TimeMark to consider the beginning timestamp of the trace. All trace events' timestamps are relative to this mark. TimeSource.Monotonic.markNow by default.
ioDispatcher
The CoroutineDispatcher to use to execute all IO operations. IO by default.
sinkProvider
Returns the BufferedSink to use to write trace events to. Called on a background thread.