Coroutines and Reactive Programming - Friends or Foes?
summary
Compares Kotlin coroutines with Reactor reactive programming using concrete code and tradeoffs: chooses Reactor (Mono, Flux) as the reactive example, shows when coroutines keep simple sequential async code readable and when Reactor’s pipeline operators and backpressure shine for streams. Demonstrates coroutine features: coroutine Dispatchers and withContext, async/await with structured concurrency, channels (hot streams) versus Flux (cold/hot), retry policies (example: exponential backoff up to 5 attempts) and interop adapters.
AI-written summary · about
chapters (12)
- 0:00Intro
- 3:15Sequential code
- 7:06Threads
- 11:20Request context
- 16:46Exception handling
- 23:21Concurrent code
- 27:50Cancellation
- 30:39Parallel code
- 36:35Stream generation
- 40:04Operators
- 41:03Custom operator
- 41:59Backpressure
related talks
26mCoroutines and Rx: A Battle Towards Asynchronicity
02h 10mDeepdive into Reactive Spring with Coroutines and Kotlin Flow
41mThe definite guide to reactive programming in Java
39mReactive for the Impatient (A Gentle Intro to Reactive Java)
41mFrom Imperative To Reactive
45mCoroutines: Kotlin Versus
32mUnderstanding the principles of Rx, Flow, Compose, and more, through Programming Paradigms
56mThirst-quenching Streams for the Reactive Mind
