when you create a `CoroutineScope` object, is ther...
# coroutines
b
when you create a
CoroutineScope
object, is there a way to wait for it to finish (like
coroutineScope
waits)?
e
Use
coroutineScope { ... }
to wait. If you need an “object”, use
async { ... }
and then
.await
on its result
b
What I mean is say I create a class
Connection
that implements
CoroutineScope
like the example activity in the docs. Then I have some service create that object and start it, since I'm not using
coroutineScope
, nothing is inherited and it's not a child, so is there a way to wait for it's scope to complete?
Only thing I can think of is access the
Job
directly and
.join
, but I was wondering if there was something specific to scopes that would make that unnecessary
e
Join the job that is