Skip to content

Releases: Kotlin/kotlinx.coroutines

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).

0.21.2

15 Jan 12:21
Compare
Choose a tag to compare
  • Fixed openSubscription extension for reactive Publisher/Observable/Flowable when used with select { ... } and added an optional request parameter to specify how many elements are requested from publisher in advance on subscription (see #197).
  • Simplified implementation of Channel.flatMap using toChannel function to work around Android 5.0 APK install SIGSEGV (see #205).

0.21.1

13 Jan 09:26
Compare
Choose a tag to compare
  • Improved performance of coroutine dispatching (DispatchTask instance is no longer allocated).
  • Fixed Job.cancel and CompletableDeferred.complete to support cancelling/completing states and properly wait for their children to complete on join/await (see #199).
  • Fixed a bug in binary heap implementation (used internally by delay) which could have resulted in wrong delay time in rare circumstances.
  • Coroutines library for Kotlin/JS:
    • Promise.asDeferred immediately installs handlers to avoid "Unhandled promise rejection" warning.
    • Use window.postMessage instead of setTimeout for coroutines inside the browser to avoid timeout throttling (see #194).
    • Use custom queue in Window.awaitAnimationFrame to align all animations and reduce overhead.
    • Introduced Window.asCoroutineDispatcher() extension function.

JS

28 Dec 15:22
Compare
Choose a tag to compare
JS
  • Migrated to Kotlin 1.2.10.
  • Coroutines library for Kotlin/JS and multiplatform projects (see #33):
    • launch and async coroutine builders.
    • Job and Deferred light-weight future with cancellation support.
    • delay and yield top-level suspending functions.
    • await extension for JS Promise and asPromise/asDeferred conversions.
    • promise coroutine builder.
    • Job() and CompletableDeferred() factories.
    • Full support for parent-child coroutine hierarchies.
    • Window.awaitAnimationFrame extension function.
    • Sample frontend Kotlin/JS application with coroutine-driven animations.
  • run is deprecated and renamed to withContext (see #134).
  • runBlocking and EventLoop implementations optimized (see #190).

0.20

04 Dec 11:58
Compare
Choose a tag to compare
  • Migrated to Kotlin 1.2.0.
  • Channels:
    • Sequence-like filter, map, etc extensions on ReceiveChannel are introduced (see #88 by @fvasco and #69 by @konrad-kaminski).
    • Introduced ReceiveChannel.cancel method.
    • All operators on ReceiveChannel fully consume the original channel (cancel it when they are done) using a helper consume extension.
    • Deprecated ActorJob and ProducerJob; actor now returns SendChannel and produce returns ReceiveChannel (see #127).
    • SendChannel.sendBlocking extension method (see #157 by @fvasco).
  • Parent-child relations between coroutines:
    • Introduced an optional parent job parameter for all coroutine builders so that code with an explict parent Job is more natural.
    • Added parent parameter to CompletableDeferred constructor.
    • Introduced Job.children property.
    • Job.cancelChildren is now an extension (member is deprecated and hidden).
    • Job.joinChildren extension is introduced.
    • Deprecated Job.attachChild as a error-prone API.
    • Fixed StackOverflow when waiting for a lot of completed children that did not remove their handlers from the parent.
  • Use java.util.ServiceLoader to find default instances of CoroutineExceptionHandler.
  • Android UI integration:
    • Use Thread.getUncaughtExceptionPreHandler to make sure that exceptions are logged before crash (see #148).
    • Introduce UI.awaitFrame for animation; added sample coroutine-based animation application for Android here.
    • Fixed delay(Long.MAX_VALUE) (see #161)
  • Added missing DefaultDispatcher on some reactive operators (see #174 by @fvasco)
  • Fixed actor and produce so that a cancellation of a Job cancels the underlying channel (closes and removes all the pending messages).
  • Fixed sporadic failure of example-context-06 (see #160)
  • Fixed hang of Job.start on lazy coroutine with attached invokeOnCompletion handler.
  • A more gradual introduction to runBlocking and coroutines in the guide (see #166).

0.19.3

27 Oct 12:22
Compare
Choose a tag to compare
  • Fixed send/openSubscription race in ArrayBroadcastChannel. This race lead to stalled (hanged) send/receive invocations.
  • Project build has been migrated to Gradle.