kotlinx.coroutines v1.4.0-M1 Release Notes
-
๐ฅ Breaking changes
- ๐ The concept of atomic cancellation in channels is removed. All operations in channels
and corresponding
Flow
operators are cancellable in non-atomic way (#1813). - โฑ If
CoroutineDispatcher
throwsRejectedExecutionException
, cancel currentJob
and schedule its execution toDispatchers.IO
(#2003). CancellableContinuation.invokeOnCancellation
is invoked if the continuation was cancelled while its resume has been dispatched (#1915).Flow.singleOrNull
operator is aligned with standard library and does not longer throwIllegalStateException
on multiple values (#2289).
๐ New experimental features
- ๐
SharedFlow
primitive for managing hot sources of events with support of various subscription mechanisms, replay logs and buffering (#2034). Flow.shareIn
andFlow.stateIn
operators to transform cold instances of flow to hotSharedFlow
andStateFlow
respectively (#2047).
Other
- ๐ Support leak-free closeable resources transfer via
onUndeliveredElement
in 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
Flow
to avoid accidental capturing of outerCoroutineScope
for cancellation check (#2038).
External contributions
- ๐ Allow nullable types in
Flow.firstOrNull
andFlow.singleOrNull
by @ansman (#2229). - โ Add
Publisher.awaitSingleOrDefault|Null|Else
extensions by @sdeleuze (#1993). awaitCancellation
top-level function by @LouisCAD (#2213).- ๐ Significant part of our Gradle build scripts were migrated to
.kts
by @turansky.
Thank you for your contributions and participation in the Kotlin community!
- ๐ The concept of atomic cancellation in channels is removed. All operations in channels
and corresponding