All Versions
83
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 5

  • v1.0.0-RC1 Changes

    • โšก๏ธ Coroutines API is updated to Kotlin 1.3.
    • ๐Ÿšš Deprecated API is removed or marked as internal.
    • โš  Experimental and internal coroutine API is marked with corresponding kotlin.experimental.Experimental annotation. If you are using @ExperimentalCoroutinesApi or @InternalCoroutinesApi you should explicitly opt-in, otherwise compilation warning (or error) will be produced.
    • ๐Ÿ‘ Unconfined dispatcher (and all dispatchers which support immediate invocation) forms event-loop on top of current thread, thus preventing all StackOverflowErrors. Unconfined dispatcher is now much safer for the general use and may leave its experimental status soon (#704).
    • ๐ŸŽ Significantly improved performance of suspending hot loops in kotlinx.coroutines (#537).
    • Proguard rules are embedded into coroutines JAR to assist jettifier (#657)
    • ๐Ÿ›  Fixed bug in shutdown sequence of runBlocking (#692).
    • ๐Ÿ—„ ReceiveChannel.receiveOrNull is marked as obsolete and deprecated.
    • ๐Ÿ—„ Job.cancel(cause) and ReceiveChannel.cancel(cause) are deprecated, cancel() returns Unit (#713).
  • v0.30.2 Changes

    • ๐Ÿ‘€ Dispatchers.Main is instantiated lazily (see #658 and #665).
    • Blocking coroutine dispatcher views are now shutdown properly (#678).
    • Prevent leaking Kotlin 1.3 from atomicfu dependency (#659).
    • Thread-pool based dispatcher factories are marked as obsolete (#261).
    • ๐Ÿ›  Fixed exception loss on withContext cancellation (#675).
  • v0.30.1 Changes

    ๐Ÿš€ Maintenance release:

    • โž• Added Dispatchers.Main to common dispatchers, which can be used from Android, Swing and JavaFx projects if a corresponding integration library is added to dependencies.
    • โœ… With Dispatchers.Main improvement tooling bug in Android Studio #626 is mitigated, so Android users now can safely start the migration to the latest kotlinx.coroutines version.
    • ๐Ÿ›  Fixed bug with thread unsafety of shutdown sequence in EventLoop.
    • โœ… Experimental coroutine dispatcher now has close contract similar to Java Executor, so it can be safely instantiated and closed multiple times (affects only unit tests).
    • โšก๏ธ Atomicfu version is updated with fixes in JS transformer (see #609)
  • v0.30.0 Changes

    • [Major] Further improvements in exception handling — no failure exception is lost.
      • async and async-like builders cancel parent on failure (it affects CompletableDeferred, and all reactive integration builders).
      • This makes parallel decomposition exception-safe and reliable without having to rember about awaitAll (see #552).
      • Job() wih parent now also cancels parent on failure consistently with other scopes.
      • All coroutine builders and Job implementations propagate failure to the parent unless it is a CancellationException.
      • Note, "scoping" builders don't "cancel the parent" verbatim, but rethrow the corresponding exception to the caller for handling.
      • SupervisorJob() and supervisorScope { ... } are introduced, allowing for a flexible implementation of custom exception-handling policies, see a [new section in the guide on supervision](docs/topics/exception-handling.md#supervision).
      • Got rid of awaitAll in documentation and rewrote currentScope section (see #624).
    • [Major] Coroutine scheduler is used for Dispatchers.Default by default instead of deprecated CommonPool.
      • "DefaultDispatcher" is used as a public name of the default impl (you'll see it thread names and in the guide).
      • -Dkotlinx.coroutines.scheduler=off can be used to switch back to CommonPool for a time being (until deprecated CommonPool is removed).
    • ๐Ÿ‘€ Make CoroutineStart.ATOMIC experimental as it covers important use-case with resource cleanup in finally block (see #627).
    • ๐Ÿ‘€ Restored binary compatibility of Executor.asCoroutineDispatcher (see #629).
    • ๐Ÿ›  Fixed OOM in thread-pool dispatchers (see #571).
    • ๐Ÿ‘€ Check for cancellation when starting coroutine with Dispatchers.Unconfined (see #621).
    • ๐ŸŽ A bunch of various performance optimizations and docs fixes, including contributions from @AlexanderPrendota, @PaulWoitaschek.
  • v0.27.0 Changes

    • [Major] Public API revision. All public API was reviewed and marked as preparation to 1.0 release:
      1. @Deprecated API. All API marked as deprecated will be removed in 1.0 release without replacement.
      2. @ExperimentalCoroutinesApi API. This API is experimental and may change in the future, but migration mechanisms will be provided. Signature, binary compatibility and semantics can be changed.
      3. @InternalCoroutinesApi. This API is intended to be used only from within kotlinx.coroutines. It can and will be changed, broken and removed in the future releases without any warnings and migration aids. If you find yourself using this API, it is better to report your use-case to Github issues, so decent, stable and well-tested alternative can be provided.
      4. @ObsoleteCoroutinesApi. This API has serious known flaws and will be replaced with a better alternative in the nearest releases.
      5. Regular public API. This API is proven to be stable and is not going to be changed. If at some point it will be discovered that such API has unfixable design flaws, it will be gradually deprecated with proper replacement and migration aid, but won't be removed for at least a year.
    • [Major] Job state machine is reworked. It includes various performance improvements, fixes in ๐Ÿ‘ป data-races which could appear in a rare circumstances and consolidation of cancellation and exception handling. ๐Ÿ‘€ Visible consequences of include more robust exception handling for large coroutines hierarchies and for different kinds of CancellationException, transparent parallel decomposition and consistent view of coroutines hierarchy in terms of its state (see #220 and #585).
    • ๐Ÿ‘€ NIO, Quasar and Rx1 integration modules are removed with no replacement (see #595, #601, #603).
    • ๐ŸŽ withContext is now aligned with structured concurrency and awaits for all launched tasks, its performance is significantly improved (see #553 and #617).
    • โž• Added integration module with Play Services Task API. Thanks @SUPERCILEX and @lucasvalenteds for the contribution!
    • ๐Ÿ‘€ Integration with Rx2 now respects nullability in type constraints (see #347). Thanks @Dmitry-Borodin for the contribution!
    • ๐Ÿ‘€ CompletableFuture.await and ListenableFuture.await now propagate cancellation to the future (see #611).
    • ๐Ÿ‘€ Cancellation of runBlocking machinery is improved (see #589).
    • Coroutine guide is restructured and split to multiple files for the sake of simplicity.
    • ๐Ÿ‘€ CoroutineScope factory methods add Job if it is missing from the context to enforce structured concurrency (see #610).
    • ๐Ÿ‘€ Handler.asCoroutineDispatcher has a name parameter for better debugging (see #615).
    • ๐Ÿ›  Fixed bug when CoroutineSchedule was closed from one of its threads (see #612).
    • ๐Ÿ‘€ Exceptions from CoroutineExceptionHandler are reported by default exception handler (see #562).
    • ๐Ÿ‘€ CoroutineName is now available from common modules (see #570).
    • โšก๏ธ Update to Kotlin 1.2.70.
  • v0.26.1 Changes

    • ๐ŸŽ Android Main dispatcher is async by default which may significantly improve UI performance. Contributed by @JakeWharton (see #427).
    • ๐Ÿ›  Fixed bug when lazily-started coroutine with registered cancellation handler was concurrently started and cancelled.
    • ๐Ÿ‘Œ Improved termination sequence in IO dispatcher.
    • ๐Ÿ›  Fixed bug with CoroutineScope.plus operator (see #559).
    • ๐Ÿ“š Various fixes in the documentation. Thanks to @SUPERCILEX, @yorlov, @dualscyther and @soudmaijer!
  • v0.26.0 Changes

    • ๐Ÿ‘€ 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) .
  • v0.25.3 Changes

    • ๐Ÿ‘€ Distribution no longer uses multi-version jar which is not supported on Android (see #510).
    • JS version of the library does not depend on AtomicFu anymore: ย  All the atomic boxes in JS are fully erased.
    • ๐Ÿš€ Note that versions 0.25.1-2 are skipped for technical reasons (they were not fully released).
  • v0.25.0 Changes

    • ๐Ÿ‘€ 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.
  • v0.24.0 Changes

    • ๐Ÿš€ Fully multiplatform release with Kotlin/Native support (see #246):
      • Only single-threaded operation inside runBlocking event loop is supported at this moment.
      • See details on setting up build environment [here](native/README.md).
    • ๐Ÿ‘Œ Improved channels:
      • Introduced SendChannel.invokeOnClose (see #341).
      • Make close, cancel, isClosedForSend, isClosedForReceive and offer linearizable with other operations (see #359).
      • Fixed bug when send operation can be stuck in channel forever.
      • Fixed broadcast channels on JS (see #412).
    • ๐Ÿ‘€ Provides BlockingChecker mechanism which checks current context (see #227).
      • Attempts to use runBlocking from any supported UI thread (Android, JavaFx, Swing) will result in exception.
    • Android:
      • Worked around Android bugs with zero-size ForkJoinPool initialization (see #432, #288).
      • Introduced UI.immediate extension as performance-optimization to immediately execute tasks which are invoked from the UI thread (see #381).
      • Use it only when absolutely needed. It breaks asynchrony of coroutines and may lead to surprising and unexpected results.
    • ๐Ÿ›  Fixed materialization of a cause exception for Job onCancelling handlers (see #436).
    • ๐Ÿ›  Fixed JavaFx UI on Java 9 (see #443).
    • ๐Ÿ›  Fixed and documented the order between cancellation handlers and continuation resume (see #415).
    • ๐Ÿ›  Fixed resumption of cancelled continuation (see #450).
    • ๐Ÿ“š Includes multiple fixes to documentation contributed by @paolop, @SahilLone, @rocketraman, @bdavisx, @mtopolnik, @Groostav.
    • โฑ Experimental coroutines scheduler preview (JVM only):
      • Written from scratch and optimized for communicating coroutines.
      • Performs significantly better than ForkJoinPool on coroutine benchmarks and for connected applications with ktor.
      • Supports automatic creating of new threads for blocking operations running on the same thread pool (with an eye on solving #79), but there is no stable public API for it just yet.
      • For preview, run JVM with -Dkotlinx.coroutines.scheduler option. In this case DefaultDispatcher is set to new experimental scheduler instead of FJP-based CommonPool.
      • Submit your feedback to issue #261.