kotlinx.coroutines v1.3.3 Release Notes

  • Flow

    • ๐ŸŽ Flow.take performance is significantly improved (#1538).
    • ๐Ÿ”€ Flow.merge operator (#1491).
    • Reactive Flow adapters are promoted to stable API (#1549).
    • ๐ŸŽ Reusable cancellable continuations were introduced that improved the performance of various flow operators and iteration over channels (#1534).
    • ๐Ÿ›  Fixed interaction of multiple flows with take operator (#1610).
    • ๐Ÿ‘ Throw NoSuchElementException instead of UnsupportedOperationException for empty Flow in reduce operator (#1659).
    • onCompletion now rethrows downstream exceptions on emit attempt (#1654).
    • ๐Ÿ‘ Allow non-emitting withContext from flow builder (#1616).

    Debugging

    • โšก๏ธ DebugProbes.dumpCoroutines is optimized to be able to print the 6-digit number of coroutines (#1535).
    • Properly capture unstarted lazy coroutines in debugger (#1544).
    • โœ… Capture coroutines launched from within a test constructor with CoroutinesTimeout test rule (#1542).
    • ๐Ÿ‘ท Stacktraces of Job-related coroutine machinery are shortened and prettified (#1574).
    • Stacktrace recovery unification that should provide a consistent experience recover of stacktrace (#1597).
    • ๐Ÿ‘ Stacktrace recovery for withTimeout is supported (#1625).
    • ๐Ÿ‘ป Do not recover exception with a single String parameter constructor that is not a message (#1631).

    Other features

    • 0๏ธโƒฃ Dispatchers.Default and Dispatchers.IO rework: CPU consumption is significantly lower, predictable idle threads termination (#840, #1046, #1286).
    • Avoid ServiceLoader for loading Dispatchers.Main (#1572, #1557, #878, #1606).
    • Consistently handle undeliverable exceptions in RxJava and Reactor integrations (#252, #1614).
    • ๐Ÿ‘ yield support in immediate dispatchers (#1474).
    • CompletableDeferred.completeWith(result: Result<T>) is introduced.
    • โž• Added support for tvOS and watchOS-based Native targets (#1596).

    ๐Ÿ› Bug fixes and improvements

    • โšก๏ธ Kotlin version is updated to 1.3.61.
    • CoroutineDispatcher.isDispatchNeeded is promoted to stable API (#1014).
    • ๐Ÿ›  Livelock and stackoverflows in mutual select expressions are fixed (#1411, #504).
    • Properly handle null values in ListenableFuture integration (#1510).
    • Making ReceiveChannel.cancel linearizability-friendly.
    • Linearizability of Channel.close in a complex contended cases (#1419).
    • ๐Ÿ›  ArrayChannel.isBufferEmpty atomicity is fixed (#1526).
    • ๐Ÿ“š Various documentation improvements.
    • โฌ‡๏ธ Reduced bytecode size of kotlinx-coroutines-core, reduced size of minified dex when using basic functionality of kotlinx-coroutines.