[concurrency-interest] [Spam]: Candidate jdk9 CompletableFuture additions

Millies, Sebastian Sebastian.Millies at softwareag.com
Wed Jan 14 12:36:30 EST 2015

-----Original Message-----
From: concurrency-interest-bounces at cs.oswego.edu [mailto:concurrency-interest-bounces at cs.oswego.edu] On Behalf Of Doug Lea
Sent: Wednesday, January 14, 2015 6:10 PM
To: Concurrency-interest at cs.oswego.edu
Subject: [Spam]: [concurrency-interest] Candidate jdk9 CompletableFuture additions

> Method orTimeout(time, unit) covers the most common timeout idiom
>     public CompletableFuture<T> orTimeout(long timeout,
>                                           TimeUnit unit)
>     Exceptionally completes this CompletableFuture with a TimeoutException if
>not otherwise completed before the given timeout.

I'd appreciate a method like orTimeout(defaultValue, time, unit), which completes normally with the given default value if not otherwise completed before the given timeout. (I would have expected this use case to be at least as completing exceptionally.)

-- Sebastian

Software AG – Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt, Germany – Registergericht/Commercial register: Darmstadt HRB 1562 - Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), Eric Duffaut, Dr. Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman of the Supervisory Board: Dr. Andreas Bereczky - http://www.softwareag.com

More information about the Concurrency-interest mailing list