FlowTurbine

interface FlowTurbine<T>

Represents active collection on a source Flow which buffers item emissions, completion, and/or errors as events for consuming.

Functions

cancel
Link copied to clipboard
abstract suspend fun cancel()
Cancel collecting events from the source Flow.
cancelAndConsumeRemainingEvents
Link copied to clipboard
abstract suspend fun cancelAndConsumeRemainingEvents(): List<Event<T>>
Cancel collecting events from the source Flow.
cancelAndIgnoreRemainingEvents
Link copied to clipboard
abstract suspend fun cancelAndIgnoreRemainingEvents(): Nothing
Cancel collecting events from the source Flow and ignore any events which have already been received.
expectComplete
Link copied to clipboard
abstract suspend fun expectComplete()
Assert that the next event received was the flow completing.
expectError
Link copied to clipboard
abstract suspend fun expectError(): Throwable
Assert that the next event received was an error terminating the flow.
expectEvent
Link copied to clipboard
abstract suspend fun expectEvent(): Event<T>
Assert that an event was received and return it.
expectItem
Link copied to clipboard
abstract suspend fun expectItem(): T
Assert that the next event received was an item and return it.
expectNoEvents
Link copied to clipboard
abstract fun expectNoEvents()
Assert that there are no unconsumed events which have been received.

Properties

timeout
Link copied to clipboard
abstract val timeout: Duration
Duration that expectItem, expectComplete, and expectError will wait for an event before throwing a timeout exception.