WriteSession

class WriteSession(scope: CoroutineScope, maxQueuedWrites: Int = DEFAULT_MAX_QUEUED_WRITES, now: () -> Long = { MonotonicClock.millis() }, onError: (Exception) -> Unit)(source)

Serializes transport writes, owns write generations, and retries only stack rejections.

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope, maxQueuedWrites: Int = DEFAULT_MAX_QUEUED_WRITES, now: () -> Long = { MonotonicClock.millis() }, onError: (Exception) -> Unit)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun enqueue(bytes: ByteArray, valid: () -> Boolean, submit: (ByteArray) -> Boolean, retryable: (ByteArray) -> Boolean, accepted: (ByteArray) -> Unit, failed: (Int) -> Unit): WriteEnqueueResult
Link copied to clipboard
Link copied to clipboard
fun reset()

Clears only this session's jobs and byte snapshots, not the caller's scope.