JEP 102 Process Updates revised API draft
Peter Levart
peter.levart at gmail.com
Fri Feb 13 15:15:18 UTC 2015
On 02/13/2015 03:22 PM, Paul Sandoz wrote:
>> >It*is* inconvenient for the user to have to use wildcards in specifying types:
>> >
>> >CompletableFuture<? extends Process> cf = process.completableFuture();
>> >
>> >...but it doesn't hinder the use of above 'cf' quite so much as 'len' in List example above, since 'T' in CompletableFuture<T> is used mostly in co-variant positions. The only methods that use it in contra-variant positions are:
>> >
>> >cf.getNow(?);
>> >cf.complete(?);
>> >cf.obtrudeValue(?);
>> >
> What about the methods with a parameter type of:
>
> CompletionStage<? extends T>
>
> such as applyToEither and acceptEither?
>
> Paul.
Oh, I see.
That's a problem, yes. And these two methods are actually very useful in
the context of processes - waiting for 1st of two processes to finish.
So the signature can only be the following:
CompletableFuture<ProcessHandle> completableFuture();
Peter
More information about the core-libs-dev
mailing list