On Thu, 6 Mar 2025 14:34:00 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Maybe it's worth using java.time.Duration, although it doesn't fit into the 
>> API very elegantly.
>
>> I wonder if the variance of the Consumer to this method should be more 
>> permissible. Something like:
>> 
>> public ForkJoinTask submitWithTimeout(Callable callable, long timeout, 
>> TimeUnit unit, Consumer<? super ForkJoinTask<? extends V>> timeoutAction) {
> 
> I think this is a good point but it might be more practical to limit it to 
> just a contravariant Consumer, as in ` Consumer<? super ForkJoinTask<V>>`.

I agree Consumer<? super ForkJoinTask<V>> is sensible. Done.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1986372835

Reply via email to