Core primitives to work with coroutines.

All Types


Base class for stateful implementations of Flow. It tracks all the properties required for context preservation and throws an IllegalStateException if any of the properties are violated.


Scope for actor coroutine builder.

kotlin.Any (extensions in package kotlinx.coroutines)

kotlin.Array (extensions in package kotlinx.coroutines.flow)


Broadcast channel is a non-blocking primitive for communication between the sender and multiple receivers that subscribe for the elements using openSubscription function and unsubscribe using ReceiveChannel.cancel function.


Cancellable continuation. It is completed when resumed or cancelled. When the cancel function is explicitly invoked, this continuation immediately resumes with a CancellationException or the specified cancel cause.



Channel is a non-blocking primitive for communication between a sender (via SendChannel) and a receiver (via ReceiveChannel). Conceptually, a channel is similar to Java’s BlockingQueue, but it has suspending operations instead of blocking ones and can be closed.


Iterator for ReceiveChannel. Instances of this interface are not thread-safe and shall not be used from concurrent coroutines.


Indicates an attempt to receive from a isClosedForReceive channel that was closed without a cause. A failed channel rethrows the original close cause exception on receive attempts.


Indicates an attempt to send to a isClosedForSend channel that was closed without a cause. A failed channel rethrows the original close cause exception on send attempts.

kotlin.collections.Collection (extensions in package kotlinx.coroutines)


A Deferred that can be completed via public functions complete or cancel.


A job that can be completed using complete function. It is returned by Job() and SupervisorJob() constructor functions.


Handler for Job.invokeOnCompletion and CancellableContinuation.invokeOnCancellation.


Broadcasts the most recently sent element (aka value) to all openSubscription subscribers.


Throwable which can be cloned during stacktrace recovery in a class-specific way. For additional information about stacktrace recovery see STACKTRACE_RECOVERY_PROPERTY_NAME

kotlin.coroutines.CoroutineContext (extensions in package kotlinx.coroutines)


Base class to be extended by all coroutine dispatcher implementations.


An optional element in the coroutine context to handle uncaught exceptions.


User-specified name of coroutine. This name is used in debugging mode. See newCoroutineContext for the description of coroutine debugging facilities.


Defines a scope for new coroutines. Every coroutine builder (like launch, async, etc) is an extension on CoroutineScope and inherits its coroutineContext to automatically propagate all its elements and cancellation.


Defines start options for coroutines builders. It is used in start parameter of launch, async, and other coroutine builder functions.


Deferred value is a non-blocking cancellable future — it is a Job with a result.


Groups various implementations of CoroutineDispatcher.


A handle to an allocated object that can be disposed to make it eligible for garbage collection.

java.util.concurrent.Executor (extensions in package kotlinx.coroutines)


CoroutineDispatcher that has underlying Executor for dispatching tasks. Instances of ExecutorCoroutineDispatcher should be closed by the owner of the dispatcher.

java.util.concurrent.ExecutorService (extensions in package kotlinx.coroutines)


Marks declarations that are still experimental in coroutines API, which means that the design of the corresponding declarations has open issues which may (or may not) lead to their changes in the future. Roughly speaking, there is a chance that those declarations will be deprecated in the near future or the semantics of their behavior may change in some way that may break some code.


A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.


FlowCollector is used as an intermediate or a terminal collector of the flow and represents an entity that accepts values emitted by the Flow.


Marks Flow-related API as a feature preview.

kotlin.Function0 (extensions in package kotlinx.coroutines.flow)


A global CoroutineScope not bound to any job.

kotlin.IntArray (extensions in package kotlinx.coroutines.flow)

kotlin.ranges.IntRange (extensions in package kotlinx.coroutines.flow)


Marks declarations that are internal in coroutines API, which means that should not be used outside of kotlinx.coroutines, because their signatures and semantics will change between future releases without any warnings and without providing any migration aids.

kotlin.collections.Iterable (extensions in package kotlinx.coroutines.flow)

kotlin.collections.Iterator (extensions in package kotlinx.coroutines.flow)


A background job. Conceptually, a job is a cancellable thing with a life-cycle that culminates in its completion.

kotlin.LongArray (extensions in package kotlinx.coroutines.flow)

kotlin.ranges.LongRange (extensions in package kotlinx.coroutines.flow)


Base class for special CoroutineDispatcher which is confined to application “Main” or “UI” thread and used for any UI-based activities. Instance of MainDispatcher can be obtained by Dispatchers.Main.


A mutable StateFlow that provides a setter for value.


Mutual exclusion for coroutines.


A non-cancelable job that is always active. It is designed for withContext function to prevent cancellation of code blocks that need to be executed without cancellation.


Marks declarations that are obsolete in coroutines API, which means that the design of the corresponding declarations has serious known flaws and they will be redesigned in the future. Roughly speaking, these declarations will be deprecated in the future but there is no replacement for them yet, so they cannot be deprecated right away.


Scope for the produce coroutine builder.

kotlin.js.Promise (extensions in package kotlinx.coroutines)


Receiver’s interface to Channel.


A runnable task for CoroutineDispatcher.dispatch.


Scope for select invocation.


Clause for select expression without additional parameters that does not select any value.


Clause for select expression without additional parameters that selects value of type Q.


Clause for select expression with additional parameter of type P that selects value of type Q.


A counting semaphore for coroutines that logically maintains a number of available permits. Each acquire takes a single permit or suspends until it is available. Each release adds a permit, potentially releasing a suspended acquirer. Semaphore is fair and maintains a FIFO order of acquirers.


Sender’s interface to Channel.

kotlin.sequences.Sequence (extensions in package kotlinx.coroutines.flow)


A Flow that represents a read-only state with a single updatable data value that emits updates to the value to its collectors. The current value can be retrieved via value property. The flow of future updates to the value can be observed by collecting values from this flow.

kotlin.SuspendFunction0 (extensions in package kotlinx.coroutines.flow)


This CoroutineContext dispatcher can be used to simulate virtual time to speed up code, especially tests, that deal with delays and timeouts in Coroutines.


Defines elements in CoroutineContext that are installed into thread context every time the coroutine with this element in the context is resumed on a thread.

java.lang.ThreadLocal (extensions in package kotlinx.coroutines)


Mode for ticker function.


This exception is thrown by withTimeout to indicate timeout.

org.w3c.dom.Window (extensions in package kotlinx.coroutines)