https://kotlinlang.org logo
#coroutines
Title
# coroutines
c

Chills

02/14/2020, 11:16 AM
so basically coroutinecontext have a scope and these are coroutinescope which provides lifecycle to coroutine.
d

diesieben07

02/14/2020, 11:31 AM
CoroutineScope
has the
CoroutineContext
. A
CoroutineContext
can have various elements, the type of element that enforces lifecyle is
Job
.
CoroutineScope
says by convention that it's provided context should always have a job. If you then call
scope.launch
the resulting job will have the scope's job as parent, so it will "inherit the lifecycle".
📸 2
3 Views