Is there a mechanism similar to `Semaphore` that h...
# coroutines
b
Is there a mechanism similar to
Semaphore
that has no available 'permits' to start? I need to launch a coroutine to keep a scope alive, but have it suspend until something else tells it to "go"
c
CompletableDeferred
is probably the easiest thing to use as a simple “signal”
b
This is perfect, thanks!
e
you can also
launch(start = CoroutineStart.LAZY)
- the resulting job will not start until you call
.start()
or
.join()
on it
b
Oh interesting, will a coroutine in unstarted state keep a parent scope alive?
e
yes
b
Great, thanks!