elizarov
12/27/2016, 6:00 PMCancellationScope
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:
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()
.