[concurrency-interest] CompletableFuture with delay

Zhong Yu zhong.j.yu at gmail.com
Mon Aug 25 10:42:53 EDT 2014


On Mon, Aug 25, 2014 at 2:55 AM, Millies, Sebastian <
Sebastian.Millies at softwareag.com> wrote:

     future.whenComplete((t, ex) -> {
>
>       if (future.isCancelled())
>
>         task.cancel(true);               // <== HERE
>
>     });
>
>
Shouldn't you always call `task.cancel()`, regardless whether the
completion of the future is due to cancellation?

Zhong Yu
bayou.io

P.S. You might want to look into other async APIs in java, like bayou.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20140825/99a9fe22/attachment.html>


More information about the Concurrency-interest mailing list