Is there a way to make `launch` behave like a daem...
# coroutines
r
Is there a way to make
launch
behave like a daemon inside its coroutine scope?
Copy code
coroutineScope {
    launch { /* do work */ }
    launch { /* do work */ }
    launch { while (true) /* Do sth until everything is done */ }
}
Instead of preventing the coroutine scope from exiting, I'd like that last launch to automatically be cancelled once all other coroutines in the scope complete. Is something like this possible without waiting for the other launches to join, and then cancelling the last job manually?