All Versions
83
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 8

  • v0.17 Changes

    • ๐Ÿ‘€ CompletableDeferred is introduced as a set-once event-like communication primitive (see #70).
      • [Coroutines guide](docs/topics/coroutines-guide.md) uses it in a section on actors.
      • CompletableDeferred is an interface with private impl (courtesy of @fvasco, see #86).
      • It extends Deferred interface with complete and completeExceptionally functions.
    • ๐Ÿ‘€ Job.join and Deferred.await wait until a cancelled coroutine stops execution (see #64).
      • Job and Deferred have a new cancelling state which they enter on invocation of cancel.
      • Job.invokeOnCompletion has an additional overload with onCancelling: Boolean parameter to install handlers that are fired as soon as coroutine enters cancelling state as opposed to waiting until it completes.
      • Internal select implementation is refactored to decouple it from JobSupport internal class and to optimize its state-machine.
      • Internal AbstractCoroutine class is refactored so that it is extended only by true coroutines, all of which support the new cancelling state.
    • CoroutineScope.context is renamed to coroutineContext to avoid conflicts with other usages of context in applications (like Android context, see #75).
    • ๐Ÿ‘€ BroadcastChannel.open is renamed to openSubscription (see #54).
    • ๐Ÿ›  Fixed StackOverflowError in a convoy of Mutex.unlock invokers with Unconfined dispatcher (see #80).
    • ๐Ÿ›  Fixed SecurityException when trying to use coroutines library with installed SecurityManager.
    • ๐Ÿ›  Fixed a bug in withTimeoutOrNull in case with nested timeouts when coroutine was cancelled before it was ever suspended.
    • ๐Ÿ›  Fixed a minor problem with awaitFirst on reactive streams that would have resulted in spurious stack-traces printed on the console when used with publishers/observables that continue to invoke onNext despite being cancelled/disposed (which they are technically allowed to do by specification).
    • All factory functions for various interfaces are implemented as top-level functions (affects Job, Channel, BroadcastChannel, Mutex, EventLoop, and CoroutineExceptionHandler). Previous approach of using operator invoke on their companion objects is deprecated.
    • Nicer-to-use debug toString implementations for coroutine dispatcher tasks and continuations.
    • 0๏ธโƒฃ A default dispatcher for delay is rewritten and now shares code with EventLoopImpl that is used by runBlocking. It internally supports non-default TimeSource so that delay-using tests can be written with "virtual time" by replacing their time source for the duration of tests (this feature is not available outside of the library).
  • v0.16 Changes

    • โฑ Coroutines that are scheduled for execution are cancellable by default now
      • suspendAtomicCancellableCoroutine function is introduced for funs like ย  send/receive/receiveOrNull that require atomic cancellation ย  (they cannot be cancelled after decision was made)
      • Coroutines started with default mode using ๐Ÿ— ย  async/launch/actor builders can be cancelled before their execution starts
      • CoroutineStart.ATOMIC is introduced as a start mode to specify that ย  coroutine cannot be cancelled before its execution starts
      • run function is also cancellable in the same way and accepts an optional CoroutineStart parameter to change this default.
    • BroadcastChannel factory function is introduced
    • CoroutineExceptionHandler factory function is introduced by @konrad-kaminski
    • [integration](integration) directory is introduced for all 3rd party integration projects
      • It has [contribution guidelines](integration/README.md#contributing) and contributions from community are welcome
      • Support for Guava ListenableFuture in the new [kotlinx-coroutines-guava](integration/kotlinx-coroutines-guava) module
      • Rx1 Scheduler support by @konrad-kaminski
    • ๐Ÿ›  Fixed a number of Channel and BroadcastChannel implementation bugs related to concurrent send/close/close of channels that lead to hanging send, offer or close operations (see #66). Thanks to @chrisly42 and @cy6erGn0m for finding them.
    • ๐Ÿ›  Fixed withTimeoutOrNull which was returning null on timeout of inner or outer withTimeout blocks (see #67). Thanks to @gregschlom for finding the problem.
    • ๐Ÿ›  Fixed a bug where Job fails to dispose a handler when it is the only handler by @uchuhimo
  • v0.15 Changes

    • 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.
  • v0.14 Changes

    • 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.
    • 0๏ธโƒฃ 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.
  • v0.13 Changes

    • ๐Ÿ†• 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.
    • 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.
    • ๐Ÿ†• 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.
  • v0.12 Changes

    • ๐Ÿš€ Switched to Kotlin version 1.1.0 release.
    • โšก๏ธ Reworked and updated utilities for [Reactive Streams](kotlinx-coroutines-reactive), [Rx 1.x](kotlinx-coroutines-rx1), and [Rx 2.x](kotlinx-coroutines-rx2) with library-specific coroutine builders, suspending functions, converters and iteration support.
    • LinkedListChannel with unlimited buffer (offer always succeeds).
    • onLock select clause and an optional owner parameter in all Mutex functions.
    • selectUnbiased function.
    • ๐Ÿ— actor coroutine builder.
    • Couple more examples for "Shared mutable state and concurrency" section and "Channels are fair" section with ping-pong table example in [coroutines guide](docs/topics/coroutines-guide.md).
  • v0.11-rc Changes

    • select expression with onJoin/onAwait/onSend/onReceive clauses.
    • ๐Ÿ“ฆ Mutex is moved to kotlinx.coroutines.sync package.
    • ClosedSendChannelException is a subclass of CancellationException now.
    • ๐Ÿ†• New sections on "Shared mutable state and concurrency" and "Select expression" in [coroutines guide](docs/topics/coroutines-guide.md).
  • v0.10-rc Changes

    • Switched to Kotlin version 1.1.0-rc-91.
    • ๐Ÿ”€ Mutex synchronization primitive is introduced.
    • ๐Ÿ— buildChannel is renamed to produce, old name is deprecated.
    • ๐Ÿ—„ Job.onCompletion is renamed to Job.invokeOnCompletion, old name is deprecated.
    • โฑ delay implementation in Swing, JavaFx, and scheduled executors is fixed to avoid an extra dispatch.
    • CancellableContinuation.resumeUndispatched is introduced to make this efficient implementation possible.
    • โœ‚ Remove unnecessary creation of CancellationException to improve performance, plus other performance improvements.
    • ๐Ÿ—„ Suppress deprecated and internal APIs from docs.
    • ๐Ÿ‘ Better docs at top level with categorized summary of classes and functions.
  • v0.8-beta Changes

    • ๐Ÿ— defer coroutine builder is renamed to async.
    • ๐Ÿ—„ lazyDefer is deprecated, async has an optional start parameter instead.
    • ๐Ÿ—„ LazyDeferred interface is deprecated, lazy start functionality is integrated into Job interface.
    • launch has an optional start parameter for lazily started coroutines.
    • ๐Ÿ‘ท Job.start and Job.isCompleted are introduced.
    • Deferred.isCompletedExceptionally and Deferred.isCancelled are introduced.
    • ๐Ÿ‘ท Job.getInactiveCancellationException is renamed to getCompletionException.
    • ๐Ÿ‘ท Job.join is now a member function.
    • ๐Ÿ†• Internal JobSupport state machine is enhanced to support new (not-started-yet) state. So, lazy coroutines do not need a separate state variable to track their started/not-started (new/active) status.
    • ๐Ÿ‘ท Exception transparency in Job.cancel (original cause is rethrown).
    • ๐Ÿ‘ท Clarified possible states for Job/CancellableContinuation/Deferred in docs.
    • ๐Ÿ’… Example on async-style functions and links to API reference site from [coroutines guide](docs/topics/coroutines-guide.md).
  • v0.7-beta Changes

    • Buffered and unbuffered channels are introduced: Channel, SendChannel, and ReceiveChannel interfaces, RendezvousChannel and ArrayChannel implementations, Channel() factory function and buildChannel{} coroutines builder.
    • ๐Ÿ—„ Here context is renamed to Unconfined (the old name is deprecated).
    • ๐Ÿ“„ A [guide on coroutines](docs/topics/coroutines-guide.md) is expanded: sections on contexts and channels.