1.4.0-M1
Breaking changes
- The concept of atomic cancellation in channels is removed. All operations in channels
and correspondingFlowoperators are cancellable in non-atomic way (#1813). - If
CoroutineDispatcherthrowsRejectedExecutionException, cancel currentJoband schedule its execution toDispatchers.IO(#2003). CancellableContinuation.invokeOnCancellationis invoked if the continuation was cancelled while its resume has been dispatched (#1915).Flow.singleOrNulloperator is aligned with standard library and does not longer throwIllegalStateExceptionon multiple values (#2289).
New experimental features
SharedFlowprimitive for managing hot sources of events with support of various subscription mechanisms, replay logs and buffering (#2034).Flow.shareInandFlow.stateInoperators to transform cold instances of flow to hotSharedFlowandStateFlowrespectively (#2047).
Other
- Support leak-free closeable resources transfer via
onUndeliveredElementin channels (#1936). - Changed ABI in reactive integrations for Java interoperability (#2182).
- Fixed ProGuard rules for
kotlinx-coroutines-core(#2046, #2266). - Lint settings were added to
Flowto avoid accidental capturing of outerCoroutineScopefor cancellation check (#2038).
External contributions
- Allow nullable types in
Flow.firstOrNullandFlow.singleOrNullby @ansman (#2229). - Add
Publisher.awaitSingleOrDefault|Null|Elseextensions by @sdeleuze (#1993). awaitCancellationtop-level function by @LouisCAD (#2213).- Significant part of our Gradle build scripts were migrated to
.ktsby @turansky.
Thank you for your contributions and participation in the Kotlin community!