CompletionStage
Sam Pullara
spullara at gmail.com
Mon Jul 1 09:16:04 PDT 2013
On Jul 1, 2013, at 5:45 AM, Doug Lea <dl at cs.oswego.edu> wrote:
>
> I think that variable "future" is not bound to the stage you have in mind?
> (The joys of fluency...)
>
> Try it with:
> ...
> CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
> sleep(1000);
> return "Doomed value";
> });
> future.cancel(true);
> future.exceptionally(...
>
> // or, as of now, you could do instead
> future.onExceptionalCompletion(t -> {
Makes some sense except for cancellation. I want that cancel() propagated through all the related futures in order to implement polling myself without threading the cancellation indicator through every layer.
Sam
> ...
>
> -Doug
>
>
>
More information about the lambda-libs-spec-observers
mailing list