[concurrency-interest] CompletableStage.whenComplete(): Completes the stage after calling the BiConsumer

Martin Buchholz martinrb at google.com
Thu Nov 7 16:41:53 EST 2019


On Thu, Nov 7, 2019 at 10:49 AM Nathan and Ila Reynolds via
Concurrency-interest <concurrency-interest at cs.oswego.edu> wrote:

> For CompletableStage.whenComplete(), the Javadoc says "The returned
> stage is completed when the action returns."  What is the reasoning for
> completing the future after action returns?

The result of the returned stage depends on whether the action failed or

> How do I run action after
> the future completes?

Why can't you just attach a completion action to either the stage returned
by whenComplete or its source?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20191107/b4237c86/attachment.html>

More information about the Concurrency-interest mailing list