Releases: Kotlin/kotlinx.coroutines
Releases · Kotlin/kotlinx.coroutines
0.23.3
0.23.2
0.23.1
- JS: Fix dependencies in NPM: add "kotlinx-atomicfu" dependency (see #370).
- Introduce
broadcastcoroutine builder (see #280):- Support
BroadcastChannel.cancelmethod to drop the buffer. - Introduce
ReceiveChannel.broadcast()extension.
- Support
- Fixed a bunch of doc typos (PRs by @paolop).
- Corrected previous version's release notes (PR by @ansman).
0.23.0
- 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:
CancellableContinuationis not aJobanymore (see #219):- It does not affect casual users of
suspendCancellableCoroutine, since all the typically used functions are still there. CancellableContinuation.invokeOnCompletionis deprecated now and its semantics had subtly changed:invokeOnCancellationis a replacement forinvokeOnCompletionto install a handler.- The handler is not invoked on
resumewhich corresponds to the typical usage pattern. - There is no need to check for
cont.isCancelledin 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
CancellableContinuationimplementation has simpler state machine and is implemented more efficiently.
- Now
- Exception handling in
AbstractContinuation(that implementsCancellableContinuation) is now consistent:- Always prefer exception thrown from coroutine as exceptional reason, add cancellation cause as suppressed exception.
- It does not affect casual users of
- Big change: Deprecate
CoroutineScope.coroutineContext:- It is replaced with top-level
coroutineContextfunction from Kotlin standard library.
- It is replaced with top-level
- Improve
ReceiveChanneloperators implementations to guarantee closing of the source channels under all circumstances (see #279):onCompletionparameter added toproduceand all other coroutine builders.- Introduce
ReceiveChannel.consumes(): CompletionHandlerextension function.
- Replace
SubscriptionReceiveChannelwithReceiveChannel(see #283, PR by @deva666).ReceiveChannel.useextension is introduced to preserve source compatibility, but is deprecated.consumeorconsumeEachextensions 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
awaitAllandjoinAllforDeferredandJoblists correspondingly (see #171). - Unwrap
CompletionExceptionexception inCompletionStage.awaitslow-path to provide consistent results (see #375). - Add extension to
ExecutorServiceto returnCloseableCoroutineDispatcher(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,withTimeoutandonTimeout(see #310). - Fix a few bugs (leaks on cancellation) in
delay:- Invoke
clearTimeouton cancellation in JSDispatcher. - Remove delayed task on cancellation from internal data structure on JVM.
- Invoke
- Introduce
tickerfunction to create "ticker channels" (see #327):- It provides analogue of RX
Observable.timerfor coroutine channels. - It is currently supported on JVM only.
- It provides analogue of RX
- 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.DEBUGvalue (see #316, PR by @dmytrodanylyk):- Made
CoroutineContext.DEBUG_PROPERTY_NAMEconstant public. - Introduce public constants with
"on","off","auto"values.
- Made
- Introduce system property to control
CommonPoolparallelism (see #343):CommonPool.DEFAULT_PARALLELISM_PROPERTY_NAMEconstant 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
0.22.4
0.22.3
- Fixed
producebuilder to close the channel on completion instead of cancelling it, which lead to lost elements with buffered channels (see #256). - Don't use
ForkJoinPoolif there is aSecurityManagerpresent to work around JNLP problems (see #216, PR by @NikolayMetchev). - JS: Check for undefined
window.addEventListenerwhen choosing default coroutine dispatcher (see #230, PR by @ScottPierce). - Update 3rd party dependencies:
- kotlinx-coroutines-rx1 to RxJava version
1.3.6. - kotlinx-coroutines-rx2 to RxJava version
2.1.9. - kotlinx-coroutines-guava to Guava version
24.0-jre.
- kotlinx-coroutines-rx1 to RxJava version
0.22.2
- Android: Use Keep annotation on AndroidExceptionPreHandler to fix the problem on Android with minification enabled (see #214).
- Reactive: Added
awaitFirstOrDefaultandawaitFirstOrNullextensions (see #224, PR by @konrad-kaminski). - Core: Fixed
withTimeoutandwithTimeoutOrNullthat 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
- Migrated to Kotlin 1.2.21.
- Improved
actorbuilder documentation (see #210) and fixed bugs in rendered documentation due to multiplatform. - Fixed
runBlockingto properly support specified dispatchers (see #209). - Fixed data race in
Jobimplementation (it was hanging atLockFreeLinkedList.helpDeleteon certain stress tests). AbstractCoroutine.onCancellationis invoked before cancellation handler that is set viainvokeOnCompletion.- Ensure that
launchhandles uncaught exception before another coroutine that usesjoinon it resumes (see #208).
0.22
- Migrated to Kotlin 1.2.20
- Introduced stable public API for
AbstractCoroutine:- Implements
Job,Continuation, andCoroutineScope. - Has overridable
onStart,onCancellation,onCompletedandonCompletedExceptionallyfunctions. - Reactive integration modules are now implemented using public API only.
- Notifies onXXX before all the installed handlers, so
launchhandles uncaught exceptions before "joining" coroutines wakeup (see #208).
- Implements