kotlinx.coroutines v0.25.0 Release Notes

    • ๐Ÿ‘€ Major rework on exception-handling and cancellation in coroutines (see #333, #452 and #451):
      • New ["Exception Handling" section in the guide](docs/topics/coroutines-guide.md#exception-handling) explains exceptions in coroutines.
      • Semantics of Job.cancel resulting Boolean value changed — true means exception was handled by the job, caller shall handle otherwise.
      • Exceptions are properly propagated from children to parents.
      • Installed CoroutineExceptionHandler for a family of coroutines receives one aggregated exception in case of failure.
      • Change handleCoroutineException contract, so custom exception handlers can't break coroutines machinery.
      • Unwrap JobCancellationException properly to provide exception transparency over whole call chain.
    • ๐Ÿ‘€ Introduced support for thread-local elements in coroutines context (see #119):
      • ThreadContextElement API for custom thread-context sensitive context elements.
      • ThreadLocal.asContextElement() extension function to convert an arbitrary thread-local into coroutine context element.
      • New ["Thread-local data" subsection in the guide](docs/topics/coroutines-guide.md#thread-local-data) with examples.
      • SLF4J Mapped Diagnostic Context (MDC) integration is provided via MDCContext element defined in [kotlinx-coroutines-slf4j](integration/kotlinx-coroutines-slf4j/README.md) integration module.
    • ๐Ÿ‘€ Introduced IO dispatcher to offload blocking I/O-intensive tasks (see #79).
    • ๐Ÿ‘€ Introduced ExecutorCoroutineDispatcher instead of CloseableCoroutineDispatcher (see #385).
    • Built with Kotlin 1.2.61 and Kotlin/Native 0.8.2.
    • ๐Ÿš€ JAR files for kotlinx-coroutines are now JEP 238 multi-release JAR files.
      • On JDK9+ VarHandle is used for atomic operations instead of Atomic*FieldUpdater for better performance.
      • See AtomicFu project for details.
    • ๐Ÿ‘€ Reversed addition of BlockingChecker extension point to control where runBlocking can be used (see #227).
      • runBlocking can be used anywhere without limitations (again), but it would still cause problems if improperly used on UI thread.
    • ๐Ÿ‘€ Corrected return-type of EventLoop pseudo-constructor (see #477, PR by @Groostav).
    • ๐Ÿ›  Fixed as*Future() integration functions to catch all Throwable exceptions (see #469).
    • ๐Ÿ›  Fixed runBlocking cancellation (see #501).
    • ๐Ÿ›  Fixed races and timing bugs in withTimeoutOrNull (see #498).
    • ๐Ÿ‘€ Execute EventLoop.invokeOnTimeout in DefaultDispatcher to allow busy-wait loops inside runBlocking (see #479).
    • โœ‚ Removed kotlinx-coroutines-io module from the project, it has moved to kotlinx-io.
    • ๐Ÿ‘€ Provide experimental API to create limited view of experimental dispatcher (see #475).
    • ๐Ÿ›  Various minor fixes by @LouisCAD, @Dmitry-Borodin.