Unconfined
object Unconfined : CoroutineDispatcher
(source)A coroutine dispatcher that is not confined to any specific thread. It executes initial continuation of the coroutine right here in the current call-frame and let the coroutine resume in whatever thread that is used by the corresponding suspending function, without mandating any specific threading policy.
Note, that if you need your coroutine to be confined to a particular thread or a thread-pool after resumption, but still want to execute it in the current call-frame until its first suspension, then you can use an optional CoroutineStart parameter in coroutine builders like launch and async setting it to the the value of CoroutineStart.UNDISPATCHED.
Functions
fun dispatch( fun dispatch( Dispatches execution of a runnable block onto another thread in the given context. |
|
fun isDispatchNeeded(context: CoroutineContext): Boolean Returns |
|
fun toString(): String |
Inherited Functions
open fun <T> interceptContinuation( Returns continuation that wraps the original continuation, thus intercepting all resumptions. |
Extension Functions
fun CoroutineContext.cancel( Cancels Job of this context with an optional cancellation cause. The result is |
|
fun CoroutineContext.cancelChildren( Cancels all children of the Job in this context with an optional cancellation cause. It does not do anything if there is no job in the context or it has no children. See Job.cancelChildren for details. |