CoroutineStart

enum CoroutineStart : Enum<CoroutineStart>

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

The summary of coroutine start options is:

  • DEFAULT -- immediately schedules coroutine for execution according to its context;

  • LAZY -- starts coroutine lazily, only when it is needed;

  • ATOMIC -- atomically (in a non-cancellable way) schedules coroutine for execution according to its context;

  • UNDISPATCHED -- immediately executes coroutine until its first suspension point in the current thread.

Entries

UNDISPATCHED
Link copied to clipboard
common
Immediately executes the coroutine until its first suspension point in the current thread similarly to the coroutine being started using Dispatchers.Unconfined.
ATOMIC
Link copied to clipboard
common
Atomically (i.e., in a non-cancellable way) schedules the coroutine for execution according to its context.
LAZY
Link copied to clipboard
common
Starts the coroutine lazily, only when it is needed.
DEFAULT
Link copied to clipboard
common
Default -- immediately schedules the coroutine for execution according to its context.

Sources

common source
Link copied to clipboard