is it possible to check if there are active jobs w...
# coroutines
m
is it possible to check if there are active jobs within a coroutineScope ?
j
m
no, it doesn't 😛 thanks anyway
j
meh
d
You can do
scope[Job].children.find { it.isActive }
This isn't universal, depends on what children you add, but if you don't create child scopes using
Job(scope[Job])
you should be fine.
t
An alternative would be to execute your actions with an actor. With the default capacity, it ensures that only one action is executed at a given time, suspending requests to execute another action until done with the current.