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
val isLazy: Boolean Returns |
Inherited Functions
operator fun <T> invoke( Starts the corresponding block as a coroutine with this coroutine start strategy. operator fun <R, T> invoke( Starts the corresponding block with receiver as a coroutine with this coroutine start strategy. |