kotlinx.coroutines v0.15 Release Notes

    • 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 behavior of withTimeout when CancellationException is suppressed inside the block. Invocation of withTimeout now always returns the result of 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.