kotlinx.coroutines v1.3.6 Release Notes
-
Flow
StateFlow
, new primitive for state handling (#1973, #1816, #395). TheStateFlow
is designed to eventually replaceConflatedBroadcastChannel
for state publication scenarios. Please, try it and share your feedback. Note, that Flow-based primitives to publish events will be added later. For events you should continue to either useBroadcastChannel(1)
, if you put events into theStateFlow
, protect them from double-processing with flags.Flow.onEmpty
operator is introduced (#1890).- Behavioural change in
Flow.onCompletion
, it is aligned withinvokeOnCompletion
now and passesCancellationException
to its cause parameter (#1693). - A lot of Flow operators have left its experimental status and are promoted to stable API.
Other
runInterruptible
primitive to tie cancellation with thread interruption for blocking calls. Contributed by @jxdabc (#1947).- Integration module with RxJava3 is introduced. Contributed by @ZacSweers (#1883)
- Integration with BlockHound in
kotlinx-coroutines-debug
module (#1821, #1060). - 🛠 Memory leak in ArrayBroadcastChannel is fixed (#1885).
- Behavioural change in
suspendCancellableCoroutine
, cancellation is established before invoking passed block argument (#1671). - 🚚 Debug agent internals are moved into
kotlinx-coroutines-core
for better integration with IDEA. It should not affect library users and all the redundant code should be properly eliminated with R8. - 🛠 ClassCastException with reusable continuations bug is fixed (#1966).
- ⏱ More precise scheduler detection for
Executor.asCoroutineDispatcher
(#1992). - ⚡️ Kotlin updated to 1.3.71.