DEFAULT

DEFAULT (source)

Default – immediately schedules coroutine for execution according to its context.

If the CoroutineDispatcher of the coroutine context returns true from CoroutineDispatcher.isDispatchNeeded function as most dispatchers do, then the coroutine code is dispatched for execution later, while the code that invoked the coroutine builder continues execution.

Note, that Unconfined dispatcher always returns false from its CoroutineDispatcher.isDispatchNeeded function, so starting coroutine with Unconfined dispatcher by DEFAULT is the same as using UNDISPATCHED.

If coroutine Job is cancelled before it even had a chance to start executing, then it will not start its execution at all, but complete with an exception.

Cancellability of coroutine at suspension points depends on the particular implementation details of suspending functions. Use suspendCancellableCoroutine to implement cancellable suspending functions.

Inherited Properties

isLazy

val isLazy: Boolean

Returns true when LAZY.

Inherited Functions

invoke

operator fun <T> invoke(
    block: suspend () -> T,
    completion: Continuation<T>
): Unit

Starts the corresponding block as a coroutine with this coroutine start strategy.

operator fun <R, T> invoke(
    block: suspend R.() -> T,
    receiver: R,
    completion: Continuation<T>
): Unit

Starts the corresponding block with receiver as a coroutine with this coroutine start strategy.