There need to be some first-class cancellation tok...
# coroutines
e
There need to be some first-class cancellation token concept. The idea is that you can create a cancelllation token
val myCancel = Cancellable()
, then start a coroutine (or multiple coroutines) with this cancellation token via
async(myCancel) {}
or
asycnGenerate(myCancel) {}
or with any other coroutine builder that accepts a dispatcher as parameter and then you can cancel all of them with just
myCancel.cancel()
. Maybe it should be called
Task
or something. The idea is that you can have some high-level task that spawns multiple coroutines in the process, but if that task is cancelled, then you need to abort all the coroutines that are running in its context.