Core primitives to work with coroutines.

All Types

kotlinx.coroutines.flow.AbstractFlow

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.

kotlinx.coroutines.channels.ActorScope

Scope for actor coroutine builder.

kotlin.Any (extensions in package kotlinx.coroutines)

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

kotlinx.coroutines.channels.BroadcastChannel

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.

kotlinx.coroutines.CancellableContinuation

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

kotlinx.coroutines.CancellationException

kotlinx.coroutines.channels.Channel

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

kotlinx.coroutines.channels.ChannelIterator

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

kotlinx.coroutines.channels.ClosedReceiveChannelException

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

kotlinx.coroutines.channels.ClosedSendChannelException

Indicates attempt to send on 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)

kotlinx.coroutines.CompletableDeferred

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

kotlinx.coroutines.CompletableJob

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

kotlinx.coroutines.CompletionHandler

Handler for Job.invokeOnCompletion and CancellableContinuation.invokeOnCancellation.

kotlinx.coroutines.channels.ConflatedBroadcastChannel

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

kotlinx.coroutines.CopyableThrowable

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)

kotlinx.coroutines.CoroutineDispatcher

Base class that shall be extended by all coroutine dispatcher implementations.

kotlinx.coroutines.CoroutineExceptionHandler

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

kotlinx.coroutines.CoroutineName

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

kotlinx.coroutines.CoroutineScope

Defines a scope for new coroutines. Every coroutine builder is an extension on CoroutineScope and inherits its coroutineContext to automatically propagate both context elements and cancellation.

kotlinx.coroutines.CoroutineStart

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

kotlinx.coroutines.Deferred

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

kotlinx.coroutines.Dispatchers

Groups various implementations of CoroutineDispatcher.

kotlinx.coroutines.DisposableHandle

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)

kotlinx.coroutines.ExecutorCoroutineDispatcher

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)

kotlinx.coroutines.ExperimentalCoroutinesApi

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.

kotlinx.coroutines.flow.Flow

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

kotlinx.coroutines.flow.FlowCollector

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

kotlinx.coroutines.FlowPreview

Marks Flow-related API as a feature preview.

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

kotlinx.coroutines.GlobalScope

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)

kotlinx.coroutines.InternalCoroutinesApi

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)

kotlinx.coroutines.Job

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)

kotlinx.coroutines.MainCoroutineDispatcher

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.

kotlinx.coroutines.sync.Mutex

Mutual exclusion for coroutines.

kotlinx.coroutines.NonCancellable

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.

kotlinx.coroutines.ObsoleteCoroutinesApi

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.

kotlinx.coroutines.channels.ProducerScope

Scope for produce coroutine builder.

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

kotlinx.coroutines.channels.ReceiveChannel

Receiver’s interface to Channel.

kotlinx.coroutines.Runnable

A runnable task for CoroutineDispatcher.dispatch.

kotlinx.coroutines.selects.SelectBuilder

Scope for select invocation.

kotlinx.coroutines.selects.SelectClause0

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

kotlinx.coroutines.selects.SelectClause1

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

kotlinx.coroutines.selects.SelectClause2

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

kotlinx.coroutines.sync.Semaphore

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.

kotlinx.coroutines.channels.SendChannel

Sender’s interface to Channel.

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

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

kotlinx.coroutines.test.TestCoroutineContext

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

kotlinx.coroutines.ThreadContextElement

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)

kotlinx.coroutines.channels.TickerMode

Mode for ticker function.

kotlinx.coroutines.TimeoutCancellationException

This exception is thrown by withTimeout to indicate timeout.

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