Skip to content

Releases: Kotlin/kotlinx.coroutines

1.3.2

25 Sep 15:57
7f0da42
Compare
Choose a tag to compare

This is a maintenance release that does not include any new features or bug fixes.

  • Reactive integrations for Flow are promoted to stable API.
  • Obsolete reactive API is deprecated.
  • Deprecation level for API deprecated in 1.3.0 is increased.
  • Various documentation improvements.

1.3.1

04 Sep 15:42
Compare
Choose a tag to compare

This is a minor update with various fixes:

  • Flow: Fix recursion in combineTransform<T1, T2, R> (#1466).
  • Fixed race in the Semaphore (#1477).
  • Repaired some of ListenableFuture.kt's cancellation corner cases (#1441).
  • Consistently unwrap exception in slow path of CompletionStage.asDeferred (#1479).
  • Various fixes in documentation (#1496, #1476, #1470, #1468).
  • Various cleanups and additions in tests.

Note: Kotlin/Native artifacts are now published with Gradle metadata format version 1.0, so you will need Gradle version 5.3 or later to use this version of kotlinx.coroutines in your Kotlin/Native project.

1.3.0

23 Aug 12:46
f7335d0
Compare
Choose a tag to compare

Flow

This version is the first stable release of Flow API.

All Flow API not marked with @FlowPreview or @ExperimentalCoroutinesApi annotations are stable and here to stay.
Flow declarations marked with @ExperimentalCoroutinesApi have the same guarantees as regular experimental API.
Please note that API marked with @FlowPreview have weak guarantees on source, binary and semantic compatibility.

Changelog

  • A new guide section about Flow.
  • CoroutineDispatcher.asExecutor extension (#1450).
  • Fixed bug when select statement could report the same exception twice (#1433).
  • Fixed context preservation in flatMapMerge in a case when collected values were immediately emitted to another flow (#1440).
  • Reactive Flow integrations enclosing files are renamed for better interoperability with Java.
  • Default buffer size in all Flow operators is increased to 64.
  • Kotlin updated to 1.3.50.

1.3.0-RC2

09 Aug 18:19
0d7f3fb
Compare
Choose a tag to compare

Flow improvements

  • Operators for UI programming are reworked for the sake of consistency, naming scheme for operator overloads is introduced:

    • combineLatest is deprecated in the favor of combine.
    • combineTransform operator for non-trivial transformations (#1224).
    • Top-level combine and combineTransform overloads for multiple flows (#1262).
    • switchMap is deprecated. flatMapLatest, mapLatest and transformLatest are introduced instead (#1335).
    • collectLatest terminal operator (#1269).
  • Improved cancellation support in flattenMerge (#1392).

  • channelFlow cancellation does not leak to the parent (#1334).

  • Fixed flow invariant enforcement for suspend fun main (#1421).

  • delayEach and delayFlow are deprecated (#1429).

General changes

  • Integration with Reactor context

    • Propagation of the coroutine context of await calls into Mono/Flux builder.
    • Publisher.asFlow propagates coroutine context from collect call to the Publisher.
    • New Flow.asFlux builder.
  • ServiceLoader-code is adjusted to avoid I/O on the Main thread on newer (3.6.0+) Android toolchain.

  • Stacktrace recovery support for minified builds on Android (#1416).

  • Guava version in kotlinx-coroutines-guava updated to 28.0.

  • setTimeout-based JS dispatcher for platforms where process is unavailable (#1404).

  • Native, JS and common modules are added to kotlinx-coroutines-bom.

  • Fixed bug with ignored acquiredPermits in Semaphore (#1423).

1.3.0-RC

19 Jul 15:43
ef696a0
Compare
Choose a tag to compare

Flow

  • Core Flow API is promoted to stable
  • New basic Flow operators: withIndex, collectIndexed, distinctUntilChanged overload
  • New core Flow operators: onStart and onCompletion
  • ReceiveChannel.consumeAsFlow and emitAll (#1340)

General changes

  • Kotlin updated to 1.3.41
  • Added kotlinx-coroutines-bom with Maven Bill of Materials (#1110)
  • Reactive integrations are seriously improved
    • All builders now are top-level functions instead of extensions on CoroutineScope and prohibit Job instance in their context to simplify lifecycle management
    • Fatal exceptions are handled consistently (#1297)
    • Integration with Reactor Context added (#284)
  • Stacktrace recovery for suspend fun main (#1328)
  • CoroutineScope.cancel extension with message (#1338)
  • Protection against non-monotonic clocks in delay (#1312)
  • Duration.ZERO is handled properly in JDK 8 extensions (#1349)
  • Library code is adjusted to be more minification-friendly

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.