Skip to content

Version 1.2.0-alpha #1057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 91 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
4b60d01
Update CHM in test to containsKey for KT-18053 fix in 1.3.20
elizarov Dec 22, 2018
b5af3ef
Do proper checkcast in takeEventLoop, throw ISE instead of TCE
qwwdfsad Jan 9, 2019
22c7809
Print stack trace in default exception handler in K/N
qwwdfsad Jan 9, 2019
8c07124
Replace old UI dispatcher name with Dispatchers.Main
mareklangiewicz Dec 31, 2018
042b209
Merge branch 'master' into develop
qwwdfsad Jan 24, 2019
e50a0fa
Migration to new multiplatorm plugin (#947)
qwwdfsad Jan 28, 2019
c055f02
Move debug example to a proper package
qwwdfsad Jan 29, 2019
3819379
Implement CoroutineStackFrame in SelectBuilderImpl
qwwdfsad Jan 15, 2019
f6f6037
Recover stacktrace in select clauses
qwwdfsad Jan 15, 2019
3e4d808
Call initCause during reflective exception copy in runCatching block …
qwwdfsad Jan 15, 2019
4ba30cd
Stacktrace recovery improvements
qwwdfsad Feb 1, 2019
418ba80
Additional documentation section about debug mode and stacktrace reco…
qwwdfsad Feb 1, 2019
a68376c
Add section about Android in debug agent readme
qwwdfsad Feb 1, 2019
4764e98
Add documentation about our compatibility policy and experimental ann…
qwwdfsad Feb 4, 2019
37f1b97
Fix typo in KDoc
qwwdfsad Jan 16, 2019
23eb49a
Update documentation for Mutex.withLock to be consistent with Mutex.lock
qwwdfsad Jan 16, 2019
d8f005c
Fixed jdk16Test
elizarov Feb 6, 2019
ee8bbfc
Start lazy actor when calling close
qwwdfsad Jan 17, 2019
841ae1b
Merge remote-tracking branch 'origin/master' into develop
elizarov Feb 7, 2019
cd2a8d7
Completable job (#971)
elizarov Feb 12, 2019
5bb8a4e
Properly close subscription on exception in Publisher.consumeEach
qwwdfsad Feb 12, 2019
bf02194
Updated webpack version for JS examples
elizarov Feb 6, 2019
ee7325e
Use Exception(message) constructor for copying if possible
elizarov Feb 15, 2019
fd2b3e9
Fixed test as this test exception is now eligible for copying, too
elizarov Feb 15, 2019
605f603
Merge branch 'master' into develop
elizarov Feb 15, 2019
f528898
Update documentation
qwwdfsad Feb 18, 2019
85c7f4d
Fix typo in IllegalArgumentException message
qwwdfsad Feb 19, 2019
3b3be2c
Remove merge leftover
qwwdfsad Feb 19, 2019
703a286
Check that worker thread belongs to the same scheduler in dispatchers…
qwwdfsad Feb 19, 2019
688aca4
Update to AtomicFU version 0.12.2
elizarov Feb 20, 2019
f18878f
Obtain real stacktrace of running coroutines in debug agent
qwwdfsad Feb 20, 2019
919284b
Update named arguments referenced issue
LouisCAD Feb 19, 2019
3f65e17
Merge pull request #967 from Kotlin/stacktrace-recovery-improvements
qwwdfsad Feb 20, 2019
36105c1
Merge branch 'master' into develop
elizarov Feb 20, 2019
3785348
Reknit after fixing indentation in code samples
elizarov Feb 20, 2019
2bdd460
CoroutinesTimeout debug rule for JUnit 4 (#991)
qwwdfsad Feb 20, 2019
8d506b3
Make SupervisorCoroutine implement ScopeCoroutine
qwwdfsad Feb 20, 2019
0cab2fa
Rollback temporary teamcity repo
elizarov Feb 22, 2019
63d1d1b
Use https in documentation and builds
elizarov Feb 22, 2019
7dd86b6
Fixed IDEA project import on Windows
elizarov Feb 24, 2019
4451d72
Make all invocations of withContext cancellable
elizarov Feb 22, 2019
b37c296
Replace UI with Dispatchers.Main in CoroutineScope documentation
qwwdfsad Feb 27, 2019
ae8a874
Cancellation in consumeEach should dispose Rx Observable
elizarov Feb 26, 2019
52700ff
Dispose/cancel reactive subscription exactly once using atomic
elizarov Feb 27, 2019
4fc4fd5
Promote MainCoroutineDispatcher.immediate to stable API
qwwdfsad Feb 27, 2019
9863de1
Promote Dispatchers.Unconfined to stable API
qwwdfsad Feb 27, 2019
372d275
Promote MainScope and CoroutineScope.cancel to stable API
qwwdfsad Feb 27, 2019
08f8214
Improve CoroutineDispatcher documentation
qwwdfsad Feb 27, 2019
c35953c
Structured concurrency for Completable/Listenable futures
elizarov Feb 24, 2019
1be63c0
Introduce JobSupport.cancelCoroutine for AbstractCoroutine-derived cl…
elizarov Feb 27, 2019
0aad8f1
Hide cancel(Throwable), introduce cancel(CancellationException)
elizarov Mar 1, 2019
5ae3947
Add ensureActive extension
qwwdfsad Mar 1, 2019
ab5bbfc
Clarify thread locals documentation
qwwdfsad Mar 1, 2019
57540d4
Add operator invoke for CoroutineDispatcher
LouisCAD Feb 11, 2019
847e68e
Mark operator invoke as experimental
LouisCAD Feb 11, 2019
96e6577
Add missing operator modifier
LouisCAD Feb 12, 2019
1c92681
Add tests
LouisCAD Feb 19, 2019
ffaedf1
Improve stacktrace merge heuristic: skip state machine meaningless fr…
qwwdfsad Mar 1, 2019
1660e6a
Update binary compatibility data
qwwdfsad Mar 1, 2019
d293639
Make JobCancellationException copyable in debug mode
elizarov Mar 4, 2019
3c56ff5
Properly proxy all methods in TimeoutCoroutine stackframe machinery
qwwdfsad Mar 5, 2019
e35baa4
Get rid of quadratic complexity during stack unrolling in debug agent…
qwwdfsad Mar 5, 2019
b367fae
Update cancellation guide: get rid of explicit Job in general code, p…
qwwdfsad Mar 1, 2019
e9123ca
Improve CoroutineScope documentation: mention job convention, get rid…
qwwdfsad Mar 1, 2019
cc42d75
Check `toMillis` overflow in operators with `Duration`
fvasco Feb 23, 2019
34eaa5c
Add coercion rationale, improve test coverage
qwwdfsad Mar 6, 2019
73b456b
Added clarification on deprecation version in code, better CE messages
elizarov Mar 6, 2019
c7cfc39
Added test for stack-trace recovery in JobCancellationException
elizarov Mar 6, 2019
d202ed9
Restore all state in TestBase even when test fails
elizarov Mar 6, 2019
a38e7d5
Remove unnecessary semicolon
satoshun Mar 11, 2019
338b231
Merge branch 'cancel-exception' into develop
qwwdfsad Mar 13, 2019
0c8789d
Handle fatal exceptions in continuation machinery using handleViaExce…
qwwdfsad Mar 7, 2019
132c1e3
Rename DispatchException to CoroutinesInternalError and make it an Er…
qwwdfsad Mar 7, 2019
4651b57
Merge with cancellation rework
qwwdfsad Mar 13, 2019
91c49e1
Update Kotlin to 1.3.21
qwwdfsad Mar 13, 2019
8273a75
Properly import resource folders in MPP
qwwdfsad Mar 15, 2019
ac136d6
Rollback to insecure http for reactivex.io (broken certificate)
elizarov Mar 15, 2019
b6f5b2c
Deprecate `SendChannel.isFull` and `ReceiveChannel.isEmpty` properties
ndkoval Mar 18, 2019
3e42850
Move `systemProp` function to the common module; only the JVM platfor…
ndkoval Mar 19, 2019
b4d3dff
Do not use reflective exception pre-handler on newer Androids, since …
qwwdfsad Mar 7, 2019
5ea9339
Merge lazy getter with AndroidExceptionPreHandler to reduce class count
qwwdfsad Mar 13, 2019
0355b2c
Add ThreadLocal.isPresent and ThreadLocal.ensurePresent methods (#1043)
qwwdfsad Mar 22, 2019
74b250f
Add a JMH producer-consumer benchmark for channels
ndkoval Mar 19, 2019
2496dc2
Rename CoroutineState to CoroutineInfo and improve its API
qwwdfsad Mar 5, 2019
1ea4da4
Merge branch 'develop' into debugger-sm-bypass
qwwdfsad Mar 22, 2019
4ebc130
Merge pull request #1023 from Kotlin/debugger-sm-bypass
qwwdfsad Mar 22, 2019
9a81342
Merge remote-tracking branch 'origin/master' into develop
qwwdfsad Mar 25, 2019
6227c64
Improved coroutine exception handling logic
elizarov Mar 19, 2019
f2604f6
Tweaked order of notifications for better error handling & consistency
elizarov Mar 22, 2019
0d69e13
Unmute test that was failing due to JS BE bug
qwwdfsad Mar 25, 2019
d36fc16
Version 1.2.0-alpha
qwwdfsad Mar 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 31 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Change log for kotlinx.coroutines

## Version 1.2.0-alpha

* 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 or 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](https://github.com/Kotlin/kotlinx.coroutines/blob/develop/docs/debugging.md) (#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 (#1008).
* `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 cleanup their resources (#939).
* Minor bugs in reactive integrations are fixed (#1008).
* Experimental scheduler shutdown sequence is fixed (#990).

## Version 1.1.1

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

This file was deleted.

43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# kotlinx.coroutines

[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![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)
[![official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
[![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)

Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
This is a companion version for Kotlin `1.3.20` release.

**NOTE**: `0.30.2` was the last release with Kotlin 1.2 and experimental coroutines.
See [COMPATIBILITY.md](COMPATIBILITY.md) for details of migration onto the stable Kotlin 1.3 coroutines.
This is a companion version for Kotlin `1.3.21` release.

```kotlin
GlobalScope.launch {
Expand All @@ -19,7 +16,7 @@ GlobalScope.launch {

## Modules

* [common](common/README.md) — common coroutines across all platforms:
* [core](kotlinx-coroutines-core/README.md) — common coroutines across all platforms:
* `launch` and `async` coroutine builders;
* `Job` and `Deferred` light-weight future with cancellation support;
* `MainScope` for Android and UI applications.
Expand All @@ -29,15 +26,17 @@ GlobalScope.launch {
* `coroutineScope` and `supervisorScope` scope builders;
* `SupervisorJob` and `CoroutineExceptionHandler` for supervision of coroutines hierarchies;
* `select` expression support and more.
* [core](core/README.md) — Kotlin/JVM implementation of common coroutines with additional features:
* [core/jvm](kotlinx-coroutines-core/jvm/) — additional core features available on Kotlin/JVM:
* `Dispatchers.IO` dispatcher for blocking coroutines;
* `Executor.asCoroutineDispatcher()` extension, custom thread pools, and more.
* [test](core/README.md) — test utilities for coroutines
* [core/js](kotlinx-coroutines-core/js/) — additional core features available on Kotlin/JS:
* Integration with `Promise`;
* Integration with `Window`.
* [test](kotlinx-coroutines-test/README.md) — test utilities for coroutines
* `Dispatchers.setMain` to override `Dispatchers.Main` in tests.
* [debug](core/README.md) — debug utilities for coroutines.
* [debug](kotlinx-coroutines-debug/README.md) — debug utilities for coroutines.
* `DebugProbes` API to probe, keep track of, print and dump active coroutines.
* [js](js/README.md) — Kotlin/JS implementation of common coroutines with `Promise` support.
* [native](native/README.md) — Kotlin/Native implementation of common coroutines with `runBlocking` single-threaded event loop.
* `CoroutinesTimeout` test rule to automatically dump coroutines on test timeout.
* [reactive](reactive/README.md) — modules that provide builders and iteration support for various reactive streams libraries:
* Reactive Streams, RxJava 2.x, and Project Reactor.
* [ui](ui/README.md) — modules that provide coroutine dispatchers for various single-threaded UI libraries:
Expand All @@ -56,9 +55,11 @@ GlobalScope.launch {
* [Guide to kotlinx.coroutines by example](docs/coroutines-guide.md) (**read it first**)
* [Guide to UI programming with coroutines](ui/coroutines-guide-ui.md)
* [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md)
* [Debugging capabilities in kotlinx.coroutines](docs/debugging.md)
* [Compatibility policy and experimental annotations](docs/compatibility.md)
* [Change log for kotlinx.coroutines](CHANGES.md)
* [Coroutines design document (KEEP)](https://github.com/Kotlin/KEEP/blob/master/proposals/coroutines.md)
* [Full kotlinx.coroutines API reference](http://kotlin.github.io/kotlinx.coroutines)
* [Full kotlinx.coroutines API reference](https://kotlin.github.io/kotlinx.coroutines)

## Using in your projects

Expand All @@ -74,15 +75,15 @@ Add dependencies (you can also add other modules that you need):
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.1.1</version>
<version>1.2.0-alpha</version>
</dependency>
```

And make sure that you use the latest Kotlin version:

```xml
<properties>
<kotlin.version>1.3.20</kotlin.version>
<kotlin.version>1.3.21</kotlin.version>
</properties>
```

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

```groovy
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.0-alpha'
}
```

And make sure that you use the latest Kotlin version:

```groovy
buildscript {
ext.kotlin_version = '1.3.20'
ext.kotlin_version = '1.3.21'
}
```

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

```groovy
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.0-alpha")
}
```

And make sure that you use the latest Kotlin version:

```groovy
plugins {
kotlin("jvm") version "1.3.20"
kotlin("jvm") version "1.3.21"
}
```

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

```groovy
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0-alpha'
```
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)
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To release new `<version>` of `kotlinx-coroutines`:
* Wait until "Build" configuration for committed `master` branch passes tests.
* Run "Deploy (Configure, RUN THIS ONE)" configuration with the corresponding new version.

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

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

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

6. Switch into `develop` branch:<br>
`git checkout develop`
Expand Down
15 changes: 12 additions & 3 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "me.champeau.gradle.jmh"

repositories {
maven { url "http://repo.typesafe.com/typesafe/releases/" }
maven { url "https://repo.typesafe.com/typesafe/releases/" }
}

jmh.jmhVersion = '1.21'

// It is better to use the following to run benchmarks, otherwise you may get unexpected errors:
// ../gradlew --no-daemon cleanJmhJar jmh
jmh {
duplicateClassesStrategy DuplicatesStrategy.INCLUDE
failOnError = true
resultFormat = 'CSV'
// include = ['.*ChannelProducerConsumer.*']
}

jmhJar {
baseName 'benchmarks'
classifier = null
Expand All @@ -20,8 +29,8 @@ jmhJar {
}

dependencies {
compile "org.openjdk.jmh:jmh-core:1.21"
compile 'com.typesafe.akka:akka-actor_2.12:2.5.0'
compile project(':kotlinx-coroutines-core-common')
compile project(':kotlinx-coroutines-core')
compile "org.openjdk.jmh:jmh-core:1.21"
}

Loading