Please enable JavaScript.
Coggle requires JavaScript to display documents.
Coroutines (anatomy Link Title (Coroutine Builder, CoroutineScope,…
Coroutines
anatomy
Link Title
Coroutine Builder
CoroutineScope
CoroutineDispatcher
CoroutineContext
Dispatcher
IO : background
Main
Default: need CPU
Create coroutines scope
GlobalScope
RunBlocking
Not call launch, async
block mainthread
Call launch, async: same Global scope
suspend function
hierarchy
launcher
a job
async
a deferred
produce
event, channel ?
suspending function
Coroutines
Link Title
CoroutineContext
CoroutineScope
Coroutine Builder
Async
same lanch
no join()
return Deferred<T>
A Deferred<T> extends a Job.
await()
Launch
context: CoroutineContext
start: CoroutineScope
DEFAULT
ATOMIC
LAZY
UNDISPATCHED
block: suspend CoroutineScope.() -> Unit
join()
a job
CoroutineDispatcher
Dispatchers.Default
Dispatchers.Main
Dispatchers.IO
Dispatchers.Unconfined