Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinFlow backpressure buffer conflateSingle-choice MCQ

A Flow uses `.buffer(capacity = 2, onBufferOverflow = BufferOverflow.SUSPEND)` between a fast emitter and a slow collector. At steady state where the buffer is full, what governs the emitter's behavior and where does the channel-based backpressure actually live?

flow { repeat(100) { emit(it) } }.buffer(2, BufferOverflow.SUSPEND) .collect { slowProcess(it) }