You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.md
+53-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,55 @@
1
1
# Change log for kotlinx.coroutines
2
2
3
+
## Version 1.2.0
4
+
5
+
* Kotlin updated to 1.3.30.
6
+
* New API: `CancellableContinuation.resume` with `onCancelling` lambda (#1044) to consistently handle closeable resources.
7
+
* Play services task version updated to 16.0.1.
8
+
*`ReceiveChannel.isEmpty` is no longer deprecated
9
+
10
+
A lot of `Flow` improvements:
11
+
* Purity property is renamed to context preservation and became more restrictive.
12
+
*`zip` and `combineLatest` operators.
13
+
* Integration with RxJava2
14
+
*`flatMap`, `merge` and `concatenate` are replaced with `flattenConcat`, `flattenMerge`, `flatMapConcat` and `flatMapMerge`.
15
+
* Various documentation improvements and minor bug fixes.
16
+
17
+
Note that `Flow`**is not** leaving its [preview status](/docs/compatibility.md#flow-preview-api).
18
+
19
+
## Version 1.2.0-alpha-2
20
+
21
+
This release contains major [feature preview](/docs/compatibility.md#flow-preview-api): cold streams aka `Flow` (#254).
22
+
23
+
Performance:
24
+
* Performance of `Dispatcher.Main` initialization is significantly improved (#878).
25
+
26
+
## Version 1.2.0-alpha
27
+
28
+
* 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).
29
+
*`CoroutineTimeout` rule or JUnit4 is introduced to simplify coroutines debugging (#938).
30
+
* Stacktrace recovery improvements. Exceptions with custom properties are no longer copied, `CopyableThrowable` interface is introduced, machinery is [documented](https://github.com/Kotlin/kotlinx.coroutines/blob/develop/docs/debugging.md) (#921, #950).
31
+
*`Dispatchers.Unconfined`, `MainCoroutineDispatcher.immediate`, `MainScope` and `CoroutineScope.cancel` are promoted to stable API (#972).
32
+
*`CompletableJob` is introduced (#971).
33
+
* Structured concurrency is integrated into futures and listenable futures (#1008).
34
+
*`ensurePresent` and `isPresent` extensions for `ThreadLocal` (#1028).
35
+
*`ensureActive` extensions for `CoroutineContext`, `CoroutineScope` and `Job` (#963).
36
+
*`SendChannel.isFull` and `ReceiveChannel.isEmpty` are deprecated (#1053).
37
+
*`withContext` checks cancellation on entering (#962).
38
+
* Operator `invoke` on `CoroutineDispatcher` (#428).
39
+
* Java 8 extensions for `delay` and `withTimeout` now properly handle too large values (#428).
40
+
* A global exception handler for fatal exceptions in coroutines is introduced (#808, #773).
41
+
* Major improvements in cancellation machinery and exceptions delivery consistency. Cancel with custom exception is completely removed.
42
+
* Kotlin version is updated to 1.3.21.
43
+
* Do not use private API on newer Androids to handle exceptions (#822).
44
+
45
+
Bug fixes:
46
+
* Proper `select` support in debug agent (#931).
47
+
* Proper `supervisorScope` support in debug agent (#915).
48
+
* Throwing `initCause` does no longer trigger an internal error (#933).
49
+
* Lazy actors are started when calling `close` in order to cleanup their resources (#939).
50
+
* Minor bugs in reactive integrations are fixed (#1008).
51
+
* Experimental scheduler shutdown sequence is fixed (#990).
52
+
3
53
## Version 1.1.1
4
54
5
55
* Maintenance release, no changes in the codebase
@@ -184,7 +234,7 @@ Visible consequences of include more robust exception handling for large corouti
184
234
* Introduced IO dispatcher to offload blocking I/O-intensive tasks (see #79).
185
235
* Introduced `ExecutorCoroutineDispatcher` instead of `CloseableCoroutineDispatcher` (see #385).
186
236
* Built with Kotlin 1.2.61 and Kotlin/Native 0.8.2.
187
-
* JAR files for `kotlinx-coroutines` are now [JEP 238](http://openjdk.java.net/jeps/238) multi-release JAR files.
237
+
* JAR files for `kotlinx-coroutines` are now [JEP 238](https://openjdk.java.net/jeps/238) multi-release JAR files.
188
238
* On JDK9+ `VarHandle` is used for atomic operations instead of `Atomic*FieldUpdater` for better performance.
189
239
* See [AtomicFu](https://github.com/Kotlin/kotlinx.atomicfu/blob/master/README.md) project for details.
190
240
* Reversed addition of `BlockingChecker` extension point to control where `runBlocking` can be used (see #227).
@@ -221,7 +271,7 @@ Visible consequences of include more robust exception handling for large corouti
221
271
* Includes multiple fixes to documentation contributed by @paolop, @SahilLone, @rocketraman, @bdavisx, @mtopolnik, @Groostav.
* Written from scratch and optimized for communicating coroutines.
224
-
* Performs significantly better than ForkJoinPool on coroutine benchmarks and for connected applications with [ktor](http://ktor.io).
274
+
* Performs significantly better than ForkJoinPool on coroutine benchmarks and for connected applications with [ktor](https://ktor.io).
225
275
* Supports automatic creating of new threads for blocking operations running on the same thread pool (with an eye on solving #79), but there is no stable public API for it just yet.
226
276
* For preview, run JVM with `-Dkotlinx.coroutines.scheduler` option. In this case `DefaultDispatcher` is set to new experimental scheduler instead of FJP-based `CommonPool`.
227
277
* Submit your feedback to issue #261.
@@ -514,7 +564,7 @@ Visible consequences of include more robust exception handling for large corouti
514
564
* Fixed bug in internal class LockFreeLinkedList that resulted in ISE under stress in extremely rare circumstances.
515
565
* Integrations:
516
566
*[quasar](integration/kotlinx-coroutines-quasar): Introduced integration with suspendable JVM functions
517
-
that are instrumented with [Parallel Universe Quasar](http://docs.paralleluniverse.co/quasar/)
567
+
that are instrumented with [Parallel Universe Quasar](https://docs.paralleluniverse.co/quasar/)
518
568
(thanks to the help of @pron).
519
569
*[reactor](reactive/kotlinx-coroutines-reactor): Replaced deprecated `setCancellation` with `onDipose` and
520
570
updated to Aluminium-SR3 release (courtesy of @yxf07, see #96)
Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
8
-
This is a companion version for Kotlin `1.3.20` release.
9
-
10
-
**NOTE**: `0.30.2` was the last release with Kotlin 1.2 and experimental coroutines.
11
-
See [COMPATIBILITY.md](COMPATIBILITY.md) for details of migration onto the stable Kotlin 1.3 coroutines.
8
+
This is a companion version for Kotlin `1.3.30` release.
12
9
13
10
```kotlin
14
-
GlobalScope.launch {
15
-
delay(1000)
16
-
println("Hello from Kotlin Coroutines!")
11
+
suspendfunmain() = coroutineScope {
12
+
launch {
13
+
delay(1000)
14
+
println("Kotlin Coroutines World!")
15
+
}
16
+
println("Hello")
17
17
}
18
18
```
19
19
20
+
> Play with coroutines online [here](https://pl.kotl.in/hG_tKbid_)
21
+
20
22
## Modules
21
23
22
-
*[common](common/README.md)— common coroutines across all platforms:
24
+
*[core](kotlinx-coroutines-core/README.md)— common coroutines across all platforms:
23
25
*`launch` and `async` coroutine builders;
24
26
*`Job` and `Deferred` light-weight future with cancellation support;
25
27
*`MainScope` for Android and UI applications.
@@ -29,15 +31,17 @@ GlobalScope.launch {
29
31
*`coroutineScope` and `supervisorScope` scope builders;
30
32
*`SupervisorJob` and `CoroutineExceptionHandler` for supervision of coroutines hierarchies;
31
33
*`select` expression support and more.
32
-
*[core](core/README.md)—Kotlin/JVM implementation of common coroutines with additional features:
34
+
*[core/jvm](kotlinx-coroutines-core/jvm/)—additional core features available on Kotlin/JVM:
33
35
*`Dispatchers.IO` dispatcher for blocking coroutines;
34
36
*`Executor.asCoroutineDispatcher()` extension, custom thread pools, and more.
35
-
*[test](core/README.md)— test utilities for coroutines
37
+
*[core/js](kotlinx-coroutines-core/js/)— additional core features available on Kotlin/JS:
38
+
* Integration with `Promise`;
39
+
* Integration with `Window`.
40
+
*[test](kotlinx-coroutines-test/README.md)— test utilities for coroutines
36
41
*`Dispatchers.setMain` to override `Dispatchers.Main` in tests.
37
-
*[debug](core/README.md)— debug utilities for coroutines.
42
+
*[debug](kotlinx-coroutines-debug/README.md)— debug utilities for coroutines.
38
43
*`DebugProbes` API to probe, keep track of, print and dump active coroutines.
39
-
*[js](js/README.md)— Kotlin/JS implementation of common coroutines with `Promise` support.
40
-
*[native](native/README.md)— Kotlin/Native implementation of common coroutines with `runBlocking` single-threaded event loop.
44
+
*`CoroutinesTimeout` test rule to automatically dump coroutines on test timeout.
41
45
*[reactive](reactive/README.md)— modules that provide builders and iteration support for various reactive streams libraries:
42
46
* Reactive Streams, RxJava 2.x, and Project Reactor.
43
47
*[ui](ui/README.md)— modules that provide coroutine dispatchers for various single-threaded UI libraries:
@@ -53,12 +57,14 @@ GlobalScope.launch {
53
57
*[Deep dive into Coroutines](https://www.youtube.com/watch?v=YrrUCSi72E8) (Roman Elizarov at KotlinConf 2017, [slides](https://www.slideshare.net/elizarov/deep-dive-into-coroutines-on-jvm-kotlinconf-2017))
54
58
*[Kotlin Coroutines in Practice](https://www.youtube.com/watch?v=a3agLJQ6vt8) (Roman Elizarov at KotlinConf 2018, [slides](https://www.slideshare.net/elizarov/kotlin-coroutines-in-practice-kotlinconf-2018))
55
59
* Guides and manuals:
56
-
*[Guide to kotlinx.coroutines by example](docs/coroutines-guide.md) (**read it first**)
60
+
*[Guide to kotlinx.coroutines by example](https://kotlinlang.org/docs/reference/coroutines/coroutines-guide.html) (**read it first**)
57
61
*[Guide to UI programming with coroutines](ui/coroutines-guide-ui.md)
58
62
*[Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md)
63
+
*[Debugging capabilities in kotlinx.coroutines](docs/debugging.md)
64
+
*[Compatibility policy and experimental annotations](docs/compatibility.md)
This gives you access to Android [Dispatchers.Main](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-android/kotlinx.coroutines.android/kotlinx.coroutines.-dispatchers/index.html)
152
159
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
153
160
exception is logged before crashing Android application, similarly to the way uncaught exceptions in
@@ -157,10 +164,35 @@ threads are handled by Android runtime.
157
164
158
165
For R8 no actions required, it will take obfuscation rules from the jar.
159
166
160
-
For Proguard you need to add options from [coroutines.pro](core/kotlinx-coroutines-core/resources/META-INF/proguard/coroutines.pro) to your rules manually.
167
+
For Proguard you need to add options from [coroutines.pro](kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro) to your rules manually.
161
168
162
169
R8 is a replacement for ProGuard in Android ecosystem, it is enabled by default since Android gradle plugin 3.3.0-beta.
163
170
171
+
### JS
172
+
173
+
[Kotlin/JS](https://kotlinlang.org/docs/reference/js-overview.html) version of `kotlinx.coroutines` is published as
0 commit comments