kotlinx.coroutines v0.26.0 Release Notes

    • ๐Ÿ‘€ Major rework of kotlinx.coroutines concurrency model (see #410 for a full explanation of the rationale behind this change):
      • All coroutine builders are now extensions on CoroutineScope and inherit its coroutineContext. Standalone builders are deprecated.
      • As a consequence, all nested coroutines launched via builders now automatically establish parent-child relationship and inherit CoroutineDispatcher.
      • All coroutine builders use Dispatchers.Default by default if CoroutineInterceptor is not present in their context.
      • CoroutineScope became the first-class citizen in kolinx.coroutines.
      • withContext block argument has CoroutineScope as a receiver.
      • GlobalScope is introduced to simplify migration to new API and to launch global-level coroutines.
      • currentScope and coroutineScope builders are introduced to extract and provide CoroutineScope.
      • Factory methods to create CoroutineScope from CoroutineContext are introduced.
      • CoroutineScope.isActive became an extension property.
      • New sections about structured concurrency in core guide: ["Structured concurrency"](docs/topics/coroutines-guide.md#structured-concurrency), ["Scope builder"](docs/topics/coroutines-guide.md#scope-builder) and ["Structured concurrency with async"](docs/topics/coroutines-guide.md#structured-concurrency-with-async).
      • New section in UI guide with Android example: ["Structured concurrency, lifecycle and coroutine parent-child hierarchy"](ui/coroutines-guide-ui.md#structured-concurrency,-lifecycle-and-coroutine-parent-child-hierarchy).
      • Deprecated reactive API is removed.
    • ๐Ÿ‘€ Dispatchers are renamed and grouped in the Dispatchers object (see #41 and #533):
      • Dispatcher names are consistent.
      • Old dispatchers including CommonPool are deprecated.
    • ๐Ÿ›  Fixed bug with JS error in rare cases in invokeOnCompletion(onCancelling = true).
    • ๐Ÿ›  Fixed loading of Android exception handler when Thread.contextClassLoader is mocked (see #530).
    • ๐Ÿ›  Fixed bug when IO dispatcher silently hung (see #524 and #525) .