169 |
|
* @return the CompletableFuture |
170 |
|
*/ |
171 |
|
public static CompletableFuture<Void> runAsync(Runnable runnable, |
172 |
< |
Executor executor) { |
172 |
> |
Executor executor) { |
173 |
|
if (executor == null || runnable == null) |
174 |
|
throw new NullPointerException(); |
175 |
|
CompletableFuture<Void> f = new CompletableFuture<Void>(); |
356 |
|
* @return the new CompletableFuture |
357 |
|
*/ |
358 |
|
public <U> CompletableFuture<U> thenApplyAsync(Function<? super T,? extends U> fn, |
359 |
< |
Executor executor) { |
359 |
> |
Executor executor) { |
360 |
|
if (executor == null) throw new NullPointerException(); |
361 |
|
return thenFunction(fn, executor); |
362 |
|
} |
456 |
|
* @param executor the executor to use for asynchronous execution |
457 |
|
* @return the new CompletableFuture |
458 |
|
*/ |
459 |
< |
public CompletableFuture<Void> thenRunAsync(Runnable action, Executor executor) { |
459 |
> |
public CompletableFuture<Void> thenRunAsync(Runnable action, |
460 |
> |
Executor executor) { |
461 |
|
if (executor == null) throw new NullPointerException(); |
462 |
|
return thenRunnable(action, executor); |
463 |
|
} |
516 |
|
*/ |
517 |
|
|
518 |
|
public <U,V> CompletableFuture<V> thenApplyAsync(CompletableFuture<? extends U> other, |
519 |
< |
BiFunction<? super T,? super U,? extends V> fn, |
520 |
< |
Executor executor) { |
519 |
> |
BiFunction<? super T,? super U,? extends V> fn, |
520 |
> |
Executor executor) { |
521 |
|
if (executor == null) throw new NullPointerException(); |
522 |
|
return andFunction(other, fn, executor); |
523 |
|
} |