[concurrency-interest] CompletableFuture with delay
zhong.j.yu at gmail.com
Mon Aug 25 11:32:44 EDT 2014
If you expose it as CompletableFuture, the caller is able to complete() it.
If you expose it as CompletionStage, the caller has no way to "cancel()" it.
Also note that CompletableFuture composition does not propagate
cancellation. If the caller of your supplyAsyncWithTimeout() decides to
cancel the returned future for some other reason, it will not trigger
`compute.cancel()` or `task.cancel()`.
future1 = ...
future2 = future1.whenComplete(...)
future2.cancel() // does not affect future1
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest