Skip to content

Releases: Kotlin/kotlinx.coroutines

Version 1.3.0-M2

26 Jun 15:43
7acaae6
Compare
Choose a tag to compare
  • Kotlin updated to 1.3.40.
  • Flow exception transparency concept.
  • New declarative Flow operators: onCompletion, catch, retryWhen, launchIn. onError* operators are deprecated in favour of catch. (#1263)
  • Publisher.asFlow is integrated with buffer operator.
  • Publisher.openSubscription default request size is 1 instead of 0 (#1267).

Version 1.2.2

19 Jun 04:28
Compare
Choose a tag to compare
  • Kotlin updated to 1.3.40.

1.3.0-M1

06 Jun 21:02
7699a20
Compare
Choose a tag to compare

Flow:

  • Core Flow interfaces and operators are graduated from preview status to experimental.
  • Context preservation invariant rework (#1210).
    • channelFlow and callbackFlow replacements for flowViaChannel for concurrent flows or callback-based APIs.
    • flow prohibits emissions from non-scoped coroutines by default and recommends to use channelFlow instead to avoid most of the concurrency-related bugs.
  • Flow cannot be implemented directly
    • AbstractFlow is introduced for extension (e.g. for managing state) and ensures all context preservation invariants.
  • Buffer size is decoupled from all operators that imply channel usage (#1233)
    • buffer operator can be used to adjust buffer size of any buffer-dependent operator (e.g. channelFlow, flowOn and flatMapMerge).
    • conflate operator is introduced.
  • Flow performance is significantly improved.
  • New operators: scan, scanReduce, first, emitAll.
  • flowWith and flowViaChannel are deprecated.
  • retry ignores cancellation exceptions from upstream when the flow was externally cancelled (#1122).
  • combineLatest overloads for multiple flows (#1193).
  • Fixed numerical overflow in drop operator.

Channels:

  • consumeEach is promoted to experimental API (#1080).
  • Conflated channels always deliver the latest value after closing (#332, #1235).
  • Non-suspending ChannelIterator.next to improve iteration performance (#1162).
  • Channel exception types are consistent with produce and are no longer swallowed as cancellation exceptions in case of programmatic errors (#957, #1128).
  • All operators on channels (that were prone to coroutine leaks) are deprecated in the favor of Flow.

General changes:

  • Kotlin updated to 1.3.31
  • Semaphore implementation (#1088)
  • Loading of Dispatchers.Main is tweaked so the latest version of R8 can completely remove I/O when loading it (#1231).
  • Performace of all JS dispatchers is significantly improved (#820).
  • withContext checks cancellation status on exit to make reasoning about sequential concurrent code easier (#1177).
  • Consistent exception handling mechanism for complex hierarchies (#689).
  • Convenient overload for CoroutinesTimeout.seconds (#1184).
  • Fix cancellation bug in onJoin (#1130).
  • Prevent internal names clash that caused errors for ProGuard (#1159).
  • POSIX's nanosleep as delay in runBlocking in K/N (#1225).

1.2.1

26 Apr 08:31
4d5246a
Compare
Choose a tag to compare

Major:

  • Infrastructure for testing coroutine-specific code in kotlinx-coroutines-test: runBlockingTest, TestCoroutineScope and TestCoroutineDispatcher, contributed by Sean McQuillan (@objcode).
  • Job.asCompletableFuture extension in jdk8 module (#1113).

Flow improvements:

  • flowViaChannel rework: block parameter is no longer suspending, but provides CoroutineScope receiver and allows conflated channel (#1081, #1112).
  • New operators: switchMap, sample, debounce (#1107).
  • consumerEach is deprecated for removal on Publisher, ObservableSource and MaybeSource, collect extension is introduced instead (#1080).

Other:

  • Race in Job.join and concurrent cancellation is fixed (#1123).
  • Stacktrace recovery machinery improved.
  • Atomicfu-related bug fixes: publish transformed sources, do not propagate transitive atomicfu dependency (#1064, #1116).
  • Misplaced resources are removed from the final jar (#1131).

1.2.0

12 Apr 18:23
Compare
Choose a tag to compare
  • Kotlin updated to 1.3.30.
  • New API: CancellableContinuation.resume with onCancelling 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 and combineLatest operators.
  • Integration with RxJava2
  • flatMap, merge and concatenate are replaced with flattenConcat, flattenMerge, flatMapConcat and flatMapMerge.
  • Various documentation improvements and minor bug fixes.

Note that Flow is not leaving its preview status.

1.2.0-alpha-2

04 Apr 12:47
d449052
Compare
Choose a tag to compare

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

26 Mar 17:54
085a4cb
Compare
Choose a tag to compare
  • 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 and CoroutineScope.cancel are promoted to stable API (#972).
  • CompletableJob is introduced (#971).
  • Structured concurrency is integrated into futures and listenable futures (#1007).
  • ensurePresent and isPresent extensions for ThreadLocal (#1028).
  • ensureActive extensions for CoroutineContext, CoroutineScope and Job (#963).
  • SendChannel.isFull and ReceiveChannel.isEmpty are deprecated (#1053).
  • withContext checks cancellation on entering (#962).
  • Operator invoke on CoroutineDispatcher (#428).
  • Java 8 extensions for delay and withTimeout 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

24 Jan 09:49
Compare
Choose a tag to compare
  • Maintenance release, no changes in the codebase
  • Kotlin is updated to 1.3.20
  • Gradle is updated to 4.10
  • Native module is published with Gradle metadata v0.4

1.1.0

21 Dec 16:05
Compare
Choose a tag to compare

Version 1.1.0

  • Kotlin version updated to 1.3.11.
  • Resumes of CancellableContinuation in the final state produce IllegalStateException (#901). This change does not affect #830, races between resume and cancellation do not lead to an exceptional situation.
  • runBlocking is integrated with Dispatchers.Unconfined by sharing an internal event loop. This change does not affect the semantics of the previously correct code but allows to mix multiple runBlocking and unconfined tasks (#860).

1.1.0-alpha

18 Dec 20:20
Compare
Choose a tag to compare
1.1.0-alpha Pre-release
Pre-release

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 arbitrary Dispatchers.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 and CoroutineScope.cancel extension (#829). One line CoroutineScope integration!
  • CancellableContinuation race between resumeWithException and cancel 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 by withTimeout instead of CancellationException 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.