It has a concept of `CancellationScope` that you c...
# coroutines
e
It has a concept of
CancellationScope
that you can explicitly create. Then if you want to start an arbitrary asynchronous computation that you plan to cancel if you don’t need, you’d do something like:
Copy code
val scope = CancellationScope()
 val dispatcher = CancellableDispatcher(scope)
 val f = async(dispatcher) { … blah-blah … }
You can use this scope for multiple async task and you can cancels them all with
scope.cancel()
.