timeoutBetweenEmissions

fun <T> Flow<T>.timeoutBetweenEmissions(timeout: Duration): Flow<T>

Fails with kotlinx.coroutines.TimeoutCancellationException when the gap between upstream emissions exceeds timeout.

The timeout also applies to the gap between the start of collection and the first emission. Values already emitted are unaffected; on timeout the upstream is cancelled and the exception is thrown to the collector.

Throws