From 8a07e5a07e90867c2c10217e90ecf31e45bba659 Mon Sep 17 00:00:00 2001 From: Roman Elizarov Date: Thu, 4 May 2017 14:39:45 +0300 Subject: [PATCH] Version 0.15 --- CHANGES.md | 90 +++++++++++++------ README.md | 8 +- pom.xml | 44 ++++----- ui/coroutines-guide-ui.md | 2 +- .../example-app/app/build.gradle | 2 +- .../example-app/build.gradle | 2 +- 6 files changed, 92 insertions(+), 56 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3d2ae223ff..1e602a70a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,45 +1,81 @@ # Change log for kotlinx.coroutines +## Version 0.15 + +* Switched to Kotlin version 1.1.2 (can still be used with 1.1.0). +* `CoroutineStart` enum is introduced for `launch`/`async`/`actor` builders: + * The usage of `luanch(context, start = false)` is deprecated and is replaced with + `launch(context, CoroutineStart.LAZY)` + * `CoroutineStart.UNDISPATCHED` is introduced to start coroutine execution immediately in the invoker thread, + so that `async(context, CoroutineStart.UNDISPATCHED)` is similar to the behavior of C# `async`. + * [Guide to UI programming with coroutines](ui/coroutines-guide-ui.md) mentions the use of it to optimize + the start of coroutines from UI threads. +* Introduced `BroadcastChannel` interface in `kotlinx-coroutines-core` module: + * It extends `SendChannel` interface and provides `open` function to create subscriptions. + * Subscriptions are represented with `SubscriptionReceiveChannel` interface. + * The corresponding `SubscriptionReceiveChannel` interfaces are removed from [reactive](reactive) implementation + modules. They use an interface defined in `kotlinx-coroutines-core` module. + * `ConflatedBroadcastChannel` implementation is provided for state-observation-like use-cases, where a coroutine or a + regular code (in UI, for example) updates the state that subscriber coroutines shall react to. + * `ArrayBroadcastChannel` implementation is provided for event-bus-like use-cases, where a sequence of events shall + be received by multiple subscribers without any omissions. + * [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md) includes + "Rx Subject vs BroadcastChannel" section. +* Pull requests from Konrad KamiƄski are merged into reactive stream implementations: + * Support for Project Reactor `Mono` and `Flux`. + See [`kotlinx-coroutines-reactor`](reactive/kotlinx-coroutines-reactor) module. + * Implemented Rx1 `Completable.awaitCompleted`. + * Added support for Rx2 `Maybe`. +* Better timeout support: + * Introduced `withTimeoutOrNull` function. + * Implemented `onTimeout` clause for `select` expressions. + * Fixed spurious concurrency inside `withTimeout` blocks on their cancellation. + * Changed the behavior of `withTimeout` when `CancellationException` is suppressed inside the block. The + invocation of `withTimeout` now always returns the result of the execution of its inner block. +* The `channel` property in `ActorScope` is promoted to a wider `Channel` type, so that an actor + can have an easy access to its own inbox send channel. +* Renamed `Mutex.withMutex` to `Mutex.withLock`, old name is deprecated. + ## Version 0.14 -* Switched to Kotlin version 1.1.1 (can still be used with 1.1.0) -* Introduced `consumeEach` helper function for channels and reactive streams, Rx 1.x, and Rx 2.x - * It ensures that streams are unsubscribed from on any exception - * Iteration with `for` loop on reactive streams is **deprecated** +* Switched to Kotlin version 1.1.1 (can still be used with 1.1.0). +* Introduced `consumeEach` helper function for channels and reactive streams, Rx 1.x, and Rx 2.x. + * It ensures that streams are unsubscribed from on any exception. + * Iteration with `for` loop on reactive streams is **deprecated**. * [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md) is updated virtually - all over the place to reflect these important changes -* Implemented `awaitFirstOrDefault` extension for reactive streams, Rx 1.x, and Rx 2.x -* Added `Mutex.withMutex` helper function + all over the place to reflect these important changes. +* Implemented `awaitFirstOrDefault` extension for reactive streams, Rx 1.x, and Rx 2.x. +* Added `Mutex.withMutex` helper function. * `kotlinx-coroutines-android` module has `provided` dependency on of Android APIs to - eliminate warnings when using it in android project + eliminate warnings when using it in android project. ## Version 0.13 -* New `kotlinx-coroutinex-android` module with Android `UI` context implementation -* Introduced `whileSelect` convenience function -* Implemented `ConflatedChannel` -* Renamed various `toXXX` conversion functions to `asXXX` (old names are deprecated) -* `run` is optimized with fast-path case and no longer has `CoroutineScope` in its block -* Fixed dispatching logic of `withTimeout` (removed extra dispatch) -* `EventLoop` that is used by `runBlocking` now implements Delay, giving more predictable test behavior +* New `kotlinx-coroutinex-android` module with Android `UI` context implementation. +* Introduced `whileSelect` convenience function. +* Implemented `ConflatedChannel`. +* Renamed various `toXXX` conversion functions to `asXXX` (old names are deprecated). +* `run` is optimized with fast-path case and no longer has `CoroutineScope` in its block. +* Fixed dispatching logic of `withTimeout` (removed extra dispatch). +* `EventLoop` that is used by `runBlocking` now implements Delay, giving more predictable test behavior. * Various refactorings related to resource management and timeouts: - * `Job.Registration` is renamed to `DisposableHandle` - * `EmptyRegistration` is renamed to `NonDisposableHandle` - * `Job.unregisterOnCompletion` is renamed to `Job.disposeOnCompletion` - * `Delay.invokeOnTimeout` is introduced - * `withTimeout` now uses `Delay.invokeOnTimeout` when available + * `Job.Registration` is renamed to `DisposableHandle`. + * `EmptyRegistration` is renamed to `NonDisposableHandle`. + * `Job.unregisterOnCompletion` is renamed to `Job.disposeOnCompletion`. + * `Delay.invokeOnTimeout` is introduced. + * `withTimeout` now uses `Delay.invokeOnTimeout` when available. * A number of improvement for reactive streams and Rx: - * Introduced `rxFlowable` builder for Rx 2.x - * `Scheduler.asCoroutineDispatcher` extension for Rx 2.x - * Fixed bug with sometimes missing `onComplete` in `publish`, `rxObservable`, and `rxFlowable` builders - * Channels that are open for reactive streams are now `Closeable` - * Fixed `CompletableSource.await` and added test for it - * Removed `rx.Completable.await` due to name conflict + * Introduced `rxFlowable` builder for Rx 2.x. + * `Scheduler.asCoroutineDispatcher` extension for Rx 2.x. + * Fixed bug with sometimes missing `onComplete` in `publish`, `rxObservable`, and `rxFlowable` builders. + * Channels that are open for reactive streams are now `Closeable`. + * Fixed `CompletableSource.await` and added test for it. + * Removed `rx.Completable.await` due to name conflict. * New documentation: * [Guide to UI programming with coroutines](ui/coroutines-guide-ui.md) * [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md) -* Code is published to JCenter repository +* Code is published to JCenter repository. ## Version 0.12 diff --git a/README.md b/README.md index c348849509..08fe145774 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Add dependencies (you can also add other modules that you need): org.jetbrains.kotlinx kotlinx-coroutines-core - 0.15-SNAPSHOT + 0.15 ``` @@ -67,7 +67,7 @@ And make sure that you use the right Kotlin version: ```xml - 1.1.1 + 1.1.2 ``` @@ -84,13 +84,13 @@ repositories { Add dependencies (you can also add other modules that you need): ```groovy -compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.15-SNAPSHOT' +compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.15' ``` And make sure that you use the right Kotlin version: ```groovy buildscript { - ext.kotlin_version = '1.1.1' + ext.kotlin_version = '1.1.2' } ``` diff --git a/pom.xml b/pom.xml index cb9dcca86d..45a224f20c 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,28 @@ + + UTF-8 + 1.1.2 + 0.9.14 + 4.12 + 1.6 + 1.6 + + + + 3.0.2 + + + + + JetBrains + JetBrains Team + JetBrains + http://www.jetbrains.com + + + https://github.com/Kotlin/kotlinx.coroutines scm:git:https://github.com/Kotlin/kotlinx.coroutines.git @@ -66,28 +88,6 @@ - - - JetBrains - JetBrains Team - JetBrains - http://www.jetbrains.com - - - - - UTF-8 - 1.1.1 - 0.9.14 - 4.12 - 1.6 - 1.6 - - - - 3.0.2 - - bintray diff --git a/ui/coroutines-guide-ui.md b/ui/coroutines-guide-ui.md index 36036bf31b..ee1888342b 100644 --- a/ui/coroutines-guide-ui.md +++ b/ui/coroutines-guide-ui.md @@ -173,7 +173,7 @@ Add dependencies on `kotlinx-coroutines-android` module to the `dependencies { . `app/build.gradle` file: ```groovy -compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.15-SNAPSHOT" +compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.15" ``` Coroutines are experimental feature in Kotlin. diff --git a/ui/kotlinx-coroutines-android/example-app/app/build.gradle b/ui/kotlinx-coroutines-android/example-app/app/build.gradle index b773066402..fb1261a25f 100644 --- a/ui/kotlinx-coroutines-android/example-app/app/build.gradle +++ b/ui/kotlinx-coroutines-android/example-app/app/build.gradle @@ -36,7 +36,7 @@ dependencies { compile 'com.android.support:design:25.2.0' testCompile 'junit:junit:4.12' compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.15-SNAPSHOT" + compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.15" } kotlin { diff --git a/ui/kotlinx-coroutines-android/example-app/build.gradle b/ui/kotlinx-coroutines-android/example-app/build.gradle index 3cb186e080..d051b606a3 100644 --- a/ui/kotlinx-coroutines-android/example-app/build.gradle +++ b/ui/kotlinx-coroutines-android/example-app/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.1.1' + ext.kotlin_version = '1.1.2' repositories { jcenter() }