Releases: Kotlin/kotlinx.coroutines
Releases · Kotlin/kotlinx.coroutines
0.22.4
0.22.3
- 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 aSecurityManager
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:
- 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
awaitFirstOrDefault
andawaitFirstOrNull
extensions (see #224, PR by @konrad-kaminski). - Core: Fixed
withTimeout
andwithTimeoutOrNull
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
- 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 atLockFreeLinkedList.helpDelete
on certain stress tests). AbstractCoroutine.onCancellation
is invoked before cancellation handler that is set viainvokeOnCompletion
.- Ensure that
launch
handles uncaught exception before another coroutine that usesjoin
on 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
,onCompleted
andonCompletedExceptionally
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).
- Implements
0.21.2
- Fixed
openSubscription
extension for reactivePublisher
/Observable
/Flowable
when used withselect { ... }
and added an optionalrequest
parameter to specify how many elements are requested from publisher in advance on subscription (see #197). - Simplified implementation of
Channel.flatMap
usingtoChannel
function to work around Android 5.0 APK install SIGSEGV (see #205).
0.21.1
- Improved performance of coroutine dispatching (
DispatchTask
instance is no longer allocated). - Fixed
Job.cancel
andCompletableDeferred.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 ofsetTimeout
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
- Migrated to Kotlin 1.2.10.
- Coroutines library for Kotlin/JS and multiplatform projects (see #33):
launch
andasync
coroutine builders.Job
andDeferred
light-weight future with cancellation support.delay
andyield
top-level suspending functions.await
extension for JSPromise
andasPromise
/asDeferred
conversions.promise
coroutine builder.Job()
andCompletableDeferred()
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 towithContext
(see #134).runBlocking
andEventLoop
implementations optimized (see #190).
0.20
- Migrated to Kotlin 1.2.0.
- Channels:
- Sequence-like
filter
,map
, etc extensions onReceiveChannel
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 helperconsume
extension. - Deprecated
ActorJob
andProducerJob
;actor
now returnsSendChannel
andproduce
returnsReceiveChannel
(see #127). SendChannel.sendBlocking
extension method (see #157 by @fvasco).
- Sequence-like
- Parent-child relations between coroutines:
- Introduced an optional
parent
job parameter for all coroutine builders so that code with an explict parentJob
is more natural. - Added
parent
parameter toCompletableDeferred
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.
- Introduced an optional
- Use
java.util.ServiceLoader
to find default instances ofCoroutineExceptionHandler
. - Android UI integration:
- Added missing
DefaultDispatcher
on some reactive operators (see #174 by @fvasco) - Fixed
actor
andproduce
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 attachedinvokeOnCompletion
handler. - A more gradual introduction to
runBlocking
and coroutines in the guide (see #166).