Skip to content

Commit c0f6bee

Browse files
committed
Release notes for version 0.23.0
1 parent 58c5fdc commit c0f6bee

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

CHANGES.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# Change log for kotlinx.coroutines
22

3+
## Version 0.23.0
4+
5+
* Kotlin 1.2.41
6+
* **Coroutines core module is made mostly cross-platform for JVM and JS**:
7+
* Migrate channels and related operators to common, so channels can be used from JS (see #201).
8+
* Most of the code is shared between JVM and JS versions using cross-platform versino of [AtomicFU](https://github.com/Kotlin/kotlinx.atomicfu) library.
9+
* The recent version of Kotlin allows default parameters in common code (see #348).
10+
* The project is built using Gradle 4.6.
11+
* **Breaking change**: `CancellableContinuation` is not a `Job` anymore (see #219):
12+
* It does not affect casual users of `suspendCancellableCoroutine`, since all the typically used functions are still there.
13+
* `CancellableContinuation.invokeOnCompletion` is deprecated now and its semantics had subtly changed:
14+
* `invokeOnCancellation` is a replacement for `invokeOnCompletion` to install a handler.
15+
* The handler is **not** invoked on `resume` which corresponds to the typical usage pattern.
16+
* There is no need to check for `cont.isCancelled` in a typical handler code anymore (since handler is invoked only when continuation is cancelled).
17+
* Multiple cancellation handlers cannot be installed.
18+
* Cancellation handlers cannot be removed (disposed of) anymore.
19+
* This change is designed to allow better performance of suspending cancellable functions:
20+
* Now `CancellableContinuation` implementation has simpler state machine and is implemented more efficiently.
21+
* Exception handling in `AbstractContinuation` (that implements `CancellableContinuation`) is now consistent:
22+
* Always prefer exception thrown from coroutine as exceptional reason, add cancellation cause as suppressed exception.
23+
* **Big change**: Deprecate `CoroutineScope.coroutineContext`:
24+
* It is replaced with top-level `coroutineContext` function from Kotlin standard library.
25+
* Improve `ReceiveChannel` operators implementations to guarantee closing of the source channels under all circumstances (see #279):
26+
* `onCompletion` parameter added to `produce` and all other coroutine builders.
27+
* Introduce `ReceiveChannel.consumes(): CompletionHandler` extension function.
28+
* Replace `SubscriptionReceiveChannel` with `ReceiveChannel` (see #283, PR by @deva666).
29+
* `ReceiveChannel.use` extension is introduced to preserve source compatibility, but is deprecated.
30+
* `consume` or `consumeEach` extensions should be used for channels.
31+
* When writing operators, `produce(onCompletion=consumes()) { ... }` pattern shall be used (see #279 above).
32+
* JS: Kotlin is declared as peer dependency in JVM (see #339, #340, PR by @ansman).
33+
* Invoke exception handler for actor on cancellation even when channel was successfully closed, so exceptions thrown by actor are always reported (see #368).
34+
* Introduce `awaitAll` and `joinAll` for `Deferred` and `Job` lists correspondingly (see #171).
35+
* Unwrap `CompletionException` exception in `CompletionStage.await` slow-path to provide consistent results (see #375).
36+
* Add extension to `ExecutorService` to return `CloseableCoroutineDispatcher` (see #278, PR by @deva666).
37+
* Fail with proper message during build if JDK_16 is not set (see #291, PR by @venkatperi).
38+
* Allow negative timeouts in `delay`, `withTimeout` and `onTimeout` (see #310).
39+
* Fix a few bugs (leaks on cancellation) in `delay`:
40+
* Invoke `clearTimeout` on cancellation in JSDispatcher.
41+
* Remove delayed task on cancellation from internal data structure on JVM.
42+
* Introduce `ticker` function to create "ticker channels" (see #327):
43+
* It provides analogue of RX `Observable.timer` for coroutine channels.
44+
* It is currently supported on JVM only.
45+
* Add a test-helper class `TestCoroutineContext` (see #297, PR by @streetsofboston).
46+
* It is currently supported on JVM only.
47+
* Ticker channels (#327) are not yet compatible with it.
48+
* Implement a better way to set `CoroutineContext.DEBUG` value (see #316, PR by @dmytrodanylyk):
49+
* Made `CoroutineContext.DEBUG_PROPERTY_NAME` constant public.
50+
* Introduce public constants with `"on"`, `"off"`, `"auto"` values.
51+
* Introduce system property to control `CommonPool` parallelism (see #343):
52+
* `CommonPool.DEFAULT_PARALLELISM_PROPERTY_NAME` constant is introduced with a value of "kotlinx.coroutines.default.parallelism".
53+
* Include package-list files into documentation site (see #290).
54+
* Fix various typos in docs (PRs by @paolop and @ArtsiomCh).
55+
356
## Version 0.22.5
457

558
* JS: Fixed main file reference in [NPM package](https://www.npmjs.com/package/kotlinx-coroutines-core)

0 commit comments

Comments
 (0)