Flow Context, Errors & Backpressure

KOTLIN › Flow

Which dispatcher a flow stage runs on, where failures can be caught, and what happens when the producer outruns the collector.

These three concerns share one theme: who is running, and what happens when the two ends of a pipeline disagree. Interviewers probe them because the mistakes are specific and recognisable: withContext inside a flow builder, a catch placed too high to see the failure, and a conflate silently fused away by a following buffer. Strong answers explain context preservation as a guarantee the library enforces rather than a convention, and can contrast Flow suspension-based backpressure with the request(n) protocol reactive-streams libraries use.

What this covers

Study this topic

Further reading