CompletionStage (was: Re: Loose ends: Optional -> CompletableFuture -> Eventual)
dl at cs.oswego.edu
Sun Jun 30 05:58:20 PDT 2013
On 06/27/13 19:29, Doug Lea wrote:
> Assuming not, I still do owe all of those people who were so
> unhappy about tabling discussion of a read-only interface for
> CompletableFuture another shot at it in light of the
> fact that we've nailed down other issues whose pending
> status was the main reason for dropping.
The simplest possible solution to this seems to be the best.
New interface CompletionStage extracts all and (almost) only the
"fluent" methods from CompletableFuture. No status methods,
result access, blocking, cancellation, etc. Which requires
(almost) no API change to CompletableFuture either.
The "almost" is added method toCompletableFuture(), that
is a kind of safe-cast/conversion to enable interoperability
among implementations. Sorta like Collection.toArray.
As a sanity check before committing, posting on concurrency-interest,
and trying to talk my way past deadline-sensitive
OpenJDK integration folks, I placed at
Any comments or suggestions would be very welcome.
More information about the lambda-libs-spec-observers