Skip to content

Releases: Kotlin/kotlinx.coroutines

0.23.3

15 Jun 12:08
Compare
Choose a tag to compare
  • Kotlin 1.2.50.
  • JS: Moved to atomicfu version 0.10.3 that properly matches NPM & Kotlin/JS module names (see #396).
  • Improve source-code compatibility with previous (0.22.x) version of openChannel().use { ... } pattern by providing deprecated extension function use on ReceiveChannel.

0.23.2

14 Jun 08:59
Compare
Choose a tag to compare
  • IO: fix joining and continuous writing byte array interference.

0.23.1

11 Jun 09:12
Compare
Choose a tag to compare
  • JS: Fix dependencies in NPM: add "kotlinx-atomicfu" dependency (see #370).
  • Introduce broadcast coroutine builder (see #280):
    • Support BroadcastChannel.cancel method to drop the buffer.
    • Introduce ReceiveChannel.broadcast() extension.
  • Fixed a bunch of doc typos (PRs by @paolop).
  • Corrected previous version's release notes (PR by @ansman).

0.23.0

08 Jun 13:57
Compare
Choose a tag to compare
  • Kotlin 1.2.41
  • Coroutines core module is made mostly cross-platform for JVM and JS:
    • Migrate channels and related operators to common, so channels can be used from JS (see #201).
    • Most of the code is shared between JVM and JS versions using cross-platform version of AtomicFU library.
    • The recent version of Kotlin allows default parameters in common code (see #348).
    • The project is built using Gradle 4.6.
  • Breaking change: CancellableContinuation is not a Job anymore (see #219):
    • It does not affect casual users of suspendCancellableCoroutine, since all the typically used functions are still there.
    • CancellableContinuation.invokeOnCompletion is deprecated now and its semantics had subtly changed:
      • invokeOnCancellation is a replacement for invokeOnCompletion to install a handler.
      • The handler is not invoked on resume which corresponds to the typical usage pattern.
      • There is no need to check for cont.isCancelled in a typical handler code anymore (since handler is invoked only when continuation is cancelled).
      • Multiple cancellation handlers cannot be installed.
      • Cancellation handlers cannot be removed (disposed of) anymore.
    • This change is designed to allow better performance of suspending cancellable functions:
      • Now CancellableContinuation implementation has simpler state machine and is implemented more efficiently.
    • Exception handling in AbstractContinuation (that implements CancellableContinuation) is now consistent:
      • Always prefer exception thrown from coroutine as exceptional reason, add cancellation cause as suppressed exception.
  • Big change: Deprecate CoroutineScope.coroutineContext:
    • It is replaced with top-level coroutineContext function from Kotlin standard library.
  • Improve ReceiveChannel operators implementations to guarantee closing of the source channels under all circumstances (see #279):
    • onCompletion parameter added to produce and all other coroutine builders.
    • Introduce ReceiveChannel.consumes(): CompletionHandler extension function.
  • Replace SubscriptionReceiveChannel with ReceiveChannel (see #283, PR by @deva666).
    • ReceiveChannel.use extension is introduced to preserve source compatibility, but is deprecated.
      • consume or consumeEach extensions should be used for channels.
      • When writing operators, produce(onCompletion=consumes()) { ... } pattern shall be used (see #279 above).
  • JS: Kotlin is declared as peer dependency (see #339, #340, PR by @ansman).
  • Invoke exception handler for actor on cancellation even when channel was successfully closed, so exceptions thrown by actor are always reported (see #368).
  • Introduce awaitAll and joinAll for Deferred and Job lists correspondingly (see #171).
  • Unwrap CompletionException exception in CompletionStage.await slow-path to provide consistent results (see #375).
  • Add extension to ExecutorService to return CloseableCoroutineDispatcher (see #278, PR by @deva666).
  • Fail with proper message during build if JDK_16 is not set (see #291, PR by @venkatperi).
  • Allow negative timeouts in delay, withTimeout and onTimeout (see #310).
  • Fix a few bugs (leaks on cancellation) in delay:
    • Invoke clearTimeout on cancellation in JSDispatcher.
    • Remove delayed task on cancellation from internal data structure on JVM.
  • Introduce ticker function to create "ticker channels" (see #327):
    • It provides analogue of RX Observable.timer for coroutine channels.
    • It is currently supported on JVM only.
  • Add a test-helper class TestCoroutineContext (see #297, PR by @streetsofboston).
    • It is currently supported on JVM only.
    • Ticker channels (#327) are not yet compatible with it.
  • Implement a better way to set CoroutineContext.DEBUG value (see #316, PR by @dmytrodanylyk):
    • Made CoroutineContext.DEBUG_PROPERTY_NAME constant public.
    • Introduce public constants with "on", "off", "auto" values.
  • Introduce system property to control CommonPool parallelism (see #343):
    • CommonPool.DEFAULT_PARALLELISM_PROPERTY_NAME constant is introduced with a value of "kotlinx.coroutines.default.parallelism".
  • Include package-list files into documentation site (see #290).
  • Fix various typos in docs (PRs by @paolop and @ArtsiomCh).

0.22.5

06 Mar 10:50
Compare
Choose a tag to compare
  • JS: Fixed main file reference in NPM package
  • Added context argument to Channel.filterNot (PR by @jcornaz).
  • Implemented debug toString for channels (see #185).

0.22.4

05 Mar 15:21
Compare
Choose a tag to compare
  • JS: Publish to NPM (see #229).
  • JS: Use node-style dispatcher on ReactNative (see #236).
  • jdk8 integration improvements:
    • Added conversion from CompletionStage to Deferred (see #262, PR by @jcornaz).
    • Use fast path in CompletionStage.await and make it cancellable.

0.22.3

23 Feb 18:55
Compare
Choose a tag to compare
  • Fixed produce builder to close the channel on completion instead of cancelling it, which lead to lost elements with buffered channels (see #256).
  • Don't use ForkJoinPool if there is a SecurityManager present to work around JNLP problems (see #216, PR by @NikolayMetchev).
  • JS: Check for undefined window.addEventListener when choosing default coroutine dispatcher (see #230, PR by @ScottPierce).
  • Update 3rd party dependencies:

0.22.2

07 Feb 19:57
Compare
Choose a tag to compare
  • Android: Use Keep annotation on AndroidExceptionPreHandler to fix the problem on Android with minification enabled (see #214).
  • Reactive: Added awaitFirstOrDefault and awaitFirstOrNull extensions (see #224, PR by @konrad-kaminski).
  • Core: Fixed withTimeout and withTimeoutOrNull that should not use equals on result (see #212, PR by @konrad-kaminski).
  • Core: Fixed hanged receive from a closed subscription of BroadcastChannel (see #226).
  • IO: fixed error propagation (see ktorio/ktor#301)
  • Include common sources into sources jar file to work around KT-20971.
  • Fixed bugs in documentation due to MPP.

0.22.1

29 Jan 18:12
Compare
Choose a tag to compare
  • Migrated to Kotlin 1.2.21.
  • Improved actor builder documentation (see #210) and fixed bugs in rendered documentation due to multiplatform.
  • Fixed runBlocking to properly support specified dispatchers (see #209).
  • Fixed data race in Job implementation (it was hanging at LockFreeLinkedList.helpDelete on certain stress tests).
  • AbstractCoroutine.onCancellation is invoked before cancellation handler that is set via invokeOnCompletion.
  • Ensure that launch handles uncaught exception before another coroutine that uses join on it resumes (see #208).

0.22

24 Jan 21:22
Compare
Choose a tag to compare
  • Migrated to Kotlin 1.2.20
  • Introduced stable public API for AbstractCoroutine:
    • Implements Job, Continuation, and CoroutineScope.
    • Has overridable onStart, onCancellation, onCompleted and onCompletedExceptionally functions.
    • Reactive integration modules are now implemented using public API only.
    • Notifies onXXX before all the installed handlers, so launch handles uncaught exceptions before "joining" coroutines wakeup (see #208).