Skip to content

Commit 085a4cb

Browse files
authored
Merge pull request #1057 from Kotlin/version-1.2.0-alpha
Version 1.2.0-alpha
2 parents 2fe443b + d36fc16 commit 085a4cb

File tree

545 files changed

+5459
-2302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+5459
-2302
lines changed

CHANGES.md

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Change log for kotlinx.coroutines
22

3+
## Version 1.2.0-alpha
4+
5+
* 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).
6+
* `CoroutineTimeout` rule or JUnit4 is introduced to simplify coroutines debugging (#938).
7+
* 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).
8+
* `Dispatchers.Unconfined`, `MainCoroutineDispatcher.immediate`, `MainScope` and `CoroutineScope.cancel` are promoted to stable API (#972).
9+
* `CompletableJob` is introduced (#971).
10+
* Structured concurrency is integrated into futures and listenable futures (#1008).
11+
* `ensurePresent` and `isPresent` extensions for `ThreadLocal` (#1028).
12+
* `ensureActive` extensions for `CoroutineContext`, `CoroutineScope` and `Job` (#963).
13+
* `SendChannel.isFull` and `ReceiveChannel.isEmpty` are deprecated (#1053).
14+
* `withContext` checks cancellation on entering (#962).
15+
* Operator `invoke` on `CoroutineDispatcher` (#428).
16+
* Java 8 extensions for `delay` and `withTimeout` now properly handle too large values (#428).
17+
* Performance of `Dispatcher.Main` initialization is significantly improved (#878).
18+
* A global exception handler for fatal exceptions in coroutines is introduced (#808, #773).
19+
* Major improvements in cancellation machinery and exceptions delivery consistency. Cancel with custom exception is completely removed.
20+
* Kotlin version is updated to 1.3.21.
21+
* Do not use private API on newer Androids to handle exceptions (#822).
22+
23+
Bug fixes:
24+
* Proper `select` support in debug agent (#931).
25+
* Proper `supervisorScope` support in debug agent (#915).
26+
* Throwing `initCause` does no longer trigger an internal error (#933).
27+
* Lazy actors are started when calling `close` in order to cleanup their resources (#939).
28+
* Minor bugs in reactive integrations are fixed (#1008).
29+
* Experimental scheduler shutdown sequence is fixed (#990).
30+
331
## Version 1.1.1
432

533
* Maintenance release, no changes in the codebase
@@ -184,7 +212,7 @@ Visible consequences of include more robust exception handling for large corouti
184212
* Introduced IO dispatcher to offload blocking I/O-intensive tasks (see #79).
185213
* Introduced `ExecutorCoroutineDispatcher` instead of `CloseableCoroutineDispatcher` (see #385).
186214
* 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.
215+
* JAR files for `kotlinx-coroutines` are now [JEP 238](https://openjdk.java.net/jeps/238) multi-release JAR files.
188216
* On JDK9+ `VarHandle` is used for atomic operations instead of `Atomic*FieldUpdater` for better performance.
189217
* See [AtomicFu](https://github.com/Kotlin/kotlinx.atomicfu/blob/master/README.md) project for details.
190218
* Reversed addition of `BlockingChecker` extension point to control where `runBlocking` can be used (see #227).
@@ -221,7 +249,7 @@ Visible consequences of include more robust exception handling for large corouti
221249
* Includes multiple fixes to documentation contributed by @paolop, @SahilLone, @rocketraman, @bdavisx, @mtopolnik, @Groostav.
222250
* Experimental coroutines scheduler preview (JVM only):
223251
* 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).
252+
* Performs significantly better than ForkJoinPool on coroutine benchmarks and for connected applications with [ktor](https://ktor.io).
225253
* 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.
226254
* For preview, run JVM with `-Dkotlinx.coroutines.scheduler` option. In this case `DefaultDispatcher` is set to new experimental scheduler instead of FJP-based `CommonPool`.
227255
* Submit your feedback to issue #261.
@@ -514,7 +542,7 @@ Visible consequences of include more robust exception handling for large corouti
514542
* Fixed bug in internal class LockFreeLinkedList that resulted in ISE under stress in extremely rare circumstances.
515543
* Integrations:
516544
* [quasar](integration/kotlinx-coroutines-quasar): Introduced integration with suspendable JVM functions
517-
that are instrumented with [Parallel Universe Quasar](http://docs.paralleluniverse.co/quasar/)
545+
that are instrumented with [Parallel Universe Quasar](https://docs.paralleluniverse.co/quasar/)
518546
(thanks to the help of @pron).
519547
* [reactor](reactive/kotlinx-coroutines-reactor): Replaced deprecated `setCancellation` with `onDipose` and
520548
updated to Aluminium-SR3 release (courtesy of @yxf07, see #96)

COMPATIBILITY.md

-25
This file was deleted.

README.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# kotlinx.coroutines
22

3-
[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
4-
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
5-
[![Download](https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=1.1.1) ](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/1.1.1)
3+
[![official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
4+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
5+
[![Download](https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=1.2.0-alpha) ](https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/1.2.0-alpha)
66

77
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.21` release.
129

1310
```kotlin
1411
GlobalScope.launch {
@@ -19,7 +16,7 @@ GlobalScope.launch {
1916

2017
## Modules
2118

22-
* [common](common/README.md) — common coroutines across all platforms:
19+
* [core](kotlinx-coroutines-core/README.md) — common coroutines across all platforms:
2320
* `launch` and `async` coroutine builders;
2421
* `Job` and `Deferred` light-weight future with cancellation support;
2522
* `MainScope` for Android and UI applications.
@@ -29,15 +26,17 @@ GlobalScope.launch {
2926
* `coroutineScope` and `supervisorScope` scope builders;
3027
* `SupervisorJob` and `CoroutineExceptionHandler` for supervision of coroutines hierarchies;
3128
* `select` expression support and more.
32-
* [core](core/README.md) — Kotlin/JVM implementation of common coroutines with additional features:
29+
* [core/jvm](kotlinx-coroutines-core/jvm/) — additional core features available on Kotlin/JVM:
3330
* `Dispatchers.IO` dispatcher for blocking coroutines;
3431
* `Executor.asCoroutineDispatcher()` extension, custom thread pools, and more.
35-
* [test](core/README.md) — test utilities for coroutines
32+
* [core/js](kotlinx-coroutines-core/js/) — additional core features available on Kotlin/JS:
33+
* Integration with `Promise`;
34+
* Integration with `Window`.
35+
* [test](kotlinx-coroutines-test/README.md) — test utilities for coroutines
3636
* `Dispatchers.setMain` to override `Dispatchers.Main` in tests.
37-
* [debug](core/README.md) — debug utilities for coroutines.
37+
* [debug](kotlinx-coroutines-debug/README.md) — debug utilities for coroutines.
3838
* `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.
39+
* `CoroutinesTimeout` test rule to automatically dump coroutines on test timeout.
4140
* [reactive](reactive/README.md) — modules that provide builders and iteration support for various reactive streams libraries:
4241
* Reactive Streams, RxJava 2.x, and Project Reactor.
4342
* [ui](ui/README.md) — modules that provide coroutine dispatchers for various single-threaded UI libraries:
@@ -56,9 +55,11 @@ GlobalScope.launch {
5655
* [Guide to kotlinx.coroutines by example](docs/coroutines-guide.md) (**read it first**)
5756
* [Guide to UI programming with coroutines](ui/coroutines-guide-ui.md)
5857
* [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md)
58+
* [Debugging capabilities in kotlinx.coroutines](docs/debugging.md)
59+
* [Compatibility policy and experimental annotations](docs/compatibility.md)
5960
* [Change log for kotlinx.coroutines](CHANGES.md)
6061
* [Coroutines design document (KEEP)](https://github.com/Kotlin/KEEP/blob/master/proposals/coroutines.md)
61-
* [Full kotlinx.coroutines API reference](http://kotlin.github.io/kotlinx.coroutines)
62+
* [Full kotlinx.coroutines API reference](https://kotlin.github.io/kotlinx.coroutines)
6263

6364
## Using in your projects
6465

@@ -74,15 +75,15 @@ Add dependencies (you can also add other modules that you need):
7475
<dependency>
7576
<groupId>org.jetbrains.kotlinx</groupId>
7677
<artifactId>kotlinx-coroutines-core</artifactId>
77-
<version>1.1.1</version>
78+
<version>1.2.0-alpha</version>
7879
</dependency>
7980
```
8081

8182
And make sure that you use the latest Kotlin version:
8283

8384
```xml
8485
<properties>
85-
<kotlin.version>1.3.20</kotlin.version>
86+
<kotlin.version>1.3.21</kotlin.version>
8687
</properties>
8788
```
8889

@@ -92,15 +93,15 @@ Add dependencies (you can also add other modules that you need):
9293

9394
```groovy
9495
dependencies {
95-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
96+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.0-alpha'
9697
}
9798
```
9899

99100
And make sure that you use the latest Kotlin version:
100101

101102
```groovy
102103
buildscript {
103-
ext.kotlin_version = '1.3.20'
104+
ext.kotlin_version = '1.3.21'
104105
}
105106
```
106107

@@ -118,15 +119,15 @@ Add dependencies (you can also add other modules that you need):
118119

119120
```groovy
120121
dependencies {
121-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1")
122+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.0-alpha")
122123
}
123124
```
124125

125126
And make sure that you use the latest Kotlin version:
126127

127128
```groovy
128129
plugins {
129-
kotlin("jvm") version "1.3.20"
130+
kotlin("jvm") version "1.3.21"
130131
}
131132
```
132133

@@ -146,7 +147,7 @@ Add [`kotlinx-coroutines-android`](ui/kotlinx-coroutines-android)
146147
module as dependency when using `kotlinx.coroutines` on Android:
147148

148149
```groovy
149-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
150+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0-alpha'
150151
```
151152
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)
152153
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this

RELEASE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To release new `<version>` of `kotlinx-coroutines`:
4949
* Wait until "Build" configuration for committed `master` branch passes tests.
5050
* Run "Deploy (Configure, RUN THIS ONE)" configuration with the corresponding new version.
5151

52-
2. In [GitHub](http://github.com/kotlin/kotlinx.coroutines) interface:
52+
2. In [GitHub](https://github.com/kotlin/kotlinx.coroutines) interface:
5353
* Create new release named as `<version>`.
5454
* Cut & paste lines from [`CHANGES.md`](CHANGES.md) into description.
5555

@@ -61,7 +61,7 @@ To release new `<version>` of `kotlinx-coroutines`:
6161
* Wait until newly published version becomes the most recent.
6262
* Sync to Maven Central.
6363

64-
5. Announce new release in [Slack](http://kotlinlang.slack.com)
64+
5. Announce new release in [Slack](https://kotlinlang.slack.com)
6565

6666
6. Switch into `develop` branch:<br>
6767
`git checkout develop`

benchmarks/build.gradle

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ apply plugin: "com.github.johnrengelman.shadow"
77
apply plugin: "me.champeau.gradle.jmh"
88

99
repositories {
10-
maven { url "http://repo.typesafe.com/typesafe/releases/" }
10+
maven { url "https://repo.typesafe.com/typesafe/releases/" }
1111
}
1212

1313
jmh.jmhVersion = '1.21'
1414

15+
// It is better to use the following to run benchmarks, otherwise you may get unexpected errors:
16+
// ../gradlew --no-daemon cleanJmhJar jmh
17+
jmh {
18+
duplicateClassesStrategy DuplicatesStrategy.INCLUDE
19+
failOnError = true
20+
resultFormat = 'CSV'
21+
// include = ['.*ChannelProducerConsumer.*']
22+
}
23+
1524
jmhJar {
1625
baseName 'benchmarks'
1726
classifier = null
@@ -20,8 +29,8 @@ jmhJar {
2029
}
2130

2231
dependencies {
32+
compile "org.openjdk.jmh:jmh-core:1.21"
2333
compile 'com.typesafe.akka:akka-actor_2.12:2.5.0'
24-
compile project(':kotlinx-coroutines-core-common')
2534
compile project(':kotlinx-coroutines-core')
26-
compile "org.openjdk.jmh:jmh-core:1.21"
2735
}
36+

0 commit comments

Comments
 (0)