Releases: Kotlin/kotlinx.coroutines
Releases · Kotlin/kotlinx.coroutines
1.1.0-alpha
Version 1.1.0-alpha
Major improvements in coroutines testing and debugging
- New module:
kotlinx-coroutines-debug
. Debug agent that improves coroutines stacktraces, allows to print all active coroutines and its hierarchies and can be installed as Java agent. - New module:
kotlinx-coroutines-test
. Allows setting arbitraryDispatchers.Main
implementation for tests (#810). - Stacktrace recovery mechanism. Exceptions from coroutines are recovered from current coroutine stacktraces to simplify exception diagnostic. Enabled in debug mode, controlled by
kotlinx.coroutines.debug
system property (#493).
Other improvements
MainScope
factory andCoroutineScope.cancel
extension (#829). One lineCoroutineScope
integration!CancellableContinuation
race betweenresumeWithException
andcancel
is addressed, exceptions during cancellation are no longer reported to exception handler (#830, #892).Dispatchers.Default
now consumes much less CPU on JVM (#840).- Better diagnostic and fast failure if an uninitialized dispatcher is used (#880).
- Conflated channel becomes linearizable.
- Fixed inconsistent coroutin es state when the result of the coroutine had type
DisposableHandle
(#835). - Fixed
JavaFx
initialization bug (#816). TimeoutCancellationException
is thrown bywithTimeout
instead ofCancellationException
if negative timeout is supplied (#870).- Kotlin/Native single-threaded workers support: coroutines can be safely used in multiple independent K/N workers.
- jsdom support in
Dispatchers.Default
on JS. - rxFlowable generic parameter is now restricted with Any.
- Guava 27 support in
kotlinx-coroutines-guava
. - Coroutines are now built with progressive mode.
- Various fixes in the documentation.
1.0.1
Version 1.0.1
- Align
publisher
implementation with Reactive TCK. - Reimplement
future
coroutine builders on top ofAbstractCoroutine
(#751). - Performance optimizations in
Dispatchers.Default
andDispatchers.IO
. - Use only public API during
JavaFx
instantiation, fixes warnings on Java 9 and build on Java 11 (#463). - Updated contract of
CancellableContinuation.resumeWithException
(documentation fix, see #712). - Check cancellation on fast-path of all in-place coroutine builders (
withContext
,coroutineScope
,supervisorScope
,withTimeout
andwithTimeoutOrNull
). - Add optional prefix to thread names of
ExperimentalCoroutineDispatcher
(#661). - Fixed bug when
ExperimentalCoroutineDispatcher
could end up in inconsistent state ifThread
constructor throws an exception (#748).
1.0.0
1.0.0-RC1
Version 1.0.0-RC1
- 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 the current thread, thus preventing allStackOverflowError
s.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)
andReceiveChannel.cancel(cause)
are deprecated,cancel()
returnsUnit
(#713).
0.30.2
Version 0.30.2
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).
0.30.1
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 latestkotlinx.coroutines
version. - Fixed bug with thread unsafety of shutdown sequence in
EventLoop
. - Experimental coroutine dispatcher now has
close
contract similar to JavaExecutor
, 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)
0.30.0-eap13
- Features based on version
0.30.0
- Uses Kotlin version
1.3.0-rc-57
- Uses Kotlin/Native version
0.9.2
- Replace buildSequence and buildIterator with sequence and iterator
- Apply @BuilderInference on all builders (including extension methods to workaround inference bug)
0.30.0
- [Major] Further improvements in exception handling — no failure exception is lost.
async
and async-like builders cancel parent on failure (it affectsCompletableDeferred
, 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 aCancellationException
. - Note, "scoping" builders don't "cancel the parent" verbatim, but rethrow the corresponding exception to the caller for handling.
SupervisorJob()
andsupervisorScope { ... }
are introduced, allowing for a flexible implementation of custom exception-handling policies, see a new section in the guide on supervision.- Got rid of
awaitAll
in documentation and rewrotecurrentScope
section (see #624).
- [Major] Coroutine scheduler is used for
Dispatchers.Default
by default instead of deprecatedCommonPool
.- "
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 toCommonPool
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.
0.27.0 Public API review
Version 0.27.0
- [Major] Public API revision. All public API was reviewed and marked as preparation to
1.0
release:@Deprecated
API. All API marked as deprecated will be removed in 1.0 release without replacement.@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.@InternalCoroutinesApi
. This API is intended to be used only from withinkotlinx.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.@ObsoleteCoroutinesApi
. This API has serious known flaws and will be replaced with a better alternative in the nearest releases.- 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 ofCancellationException
, 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
andListenableFuture.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 addJob
if it is missing from the context to enforce structured concurrency (see #610).Handler.asCoroutineDispatcher
has aname
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.
0.26.1
Version 0.26.1
- Android
Main
dispatcher isasync
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!