Releases: Kotlin/kotlinx.coroutines
Releases · Kotlin/kotlinx.coroutines
1.2.0
- Kotlin updated to 1.3.30.
- New API:
CancellableContinuation.resume
withonCancelling
lambda (#1044) to consistently handle closeable resources. - Play services task version updated to 16.0.1.
ReceiveChannel.isEmpty
is no longer deprecated
A lot of Flow
improvements:
- Purity property is renamed to context preservation and became more restrictive.
zip
andcombineLatest
operators.- Integration with RxJava2
flatMap
,merge
andconcatenate
are replaced withflattenConcat
,flattenMerge
,flatMapConcat
andflatMapMerge
.- Various documentation improvements and minor bug fixes.
Note that Flow
is not leaving its preview status.
1.2.0-alpha-2
This release contains major feature preview: cold streams aka Flow
(#254).
Performance:
- Performance of
Dispatcher.Main
initialization is significantly improved (#878).
1.2.0-alpha
- Major debug agent improvements. Real stacktraces are merged with coroutine stacktraces for running coroutines, merging heuristic is improved, API is cleaned up and is on its road to stabilization (#997).
CoroutineTimeout
rule for JUnit4 is introduced to simplify coroutines debugging (#938).- Stacktrace recovery improvements. Exceptions with custom properties are no longer copied,
CopyableThrowable
interface is introduced, machinery is documented (#921, #950). Dispatchers.Unconfined
,MainCoroutineDispatcher.immediate
,MainScope
andCoroutineScope.cancel
are promoted to stable API (#972).CompletableJob
is introduced (#971).- Structured concurrency is integrated into futures and listenable futures (#1007).
ensurePresent
andisPresent
extensions forThreadLocal
(#1028).ensureActive
extensions forCoroutineContext
,CoroutineScope
andJob
(#963).SendChannel.isFull
andReceiveChannel.isEmpty
are deprecated (#1053).withContext
checks cancellation on entering (#962).- Operator
invoke
onCoroutineDispatcher
(#428). - Java 8 extensions for
delay
andwithTimeout
now properly handle too large values (#428). - Performance of
Dispatcher.Main
initialization is significantly improved (#878). - A global exception handler for fatal exceptions in coroutines is introduced (#808, #773).
- Major improvements in cancellation machinery and exceptions delivery consistency. Cancel with custom exception is completely removed.
- Kotlin version is updated to 1.3.21.
- Do not use private API on newer Androids to handle exceptions (#822).
Bug fixes:
- Proper
select
support in debug agent (#931). - Proper
supervisorScope
support in debug agent (#915). - Throwing
initCause
does no longer trigger an internal error (#933). - Lazy actors are started when calling
close
in order to clean up their resources (#939). - Minor bugs in reactive integrations are fixed (#1008).
- Experimental scheduler shutdown sequence is fixed (#990).
1.1.1
1.1.0
Version 1.1.0
- Kotlin version updated to 1.3.11.
- Resumes of
CancellableContinuation
in the final state produceIllegalStateException
(#901). This change does not affect #830, races between resume and cancellation do not lead to an exceptional situation. runBlocking
is integrated withDispatchers.Unconfined
by sharing an internal event loop. This change does not affect the semantics of the previously correct code but allows to mix multiplerunBlocking
and unconfined tasks (#860).
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).