Skip to content

Instantly share code, notes, and snippets.

@rayhon1014
Last active December 6, 2016 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayhon1014/f78378918f4cc673f65d61db51e678e1 to your computer and use it in GitHub Desktop.
Save rayhon1014/f78378918f4cc673f65d61db51e678e1 to your computer and use it in GitHub Desktop.
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
return asyncSupplyStage(asyncPool, supplier);
}
public <U> CompletableFuture<U> thenApply(Function<? super T,? extends U> fn) {
return uniApplyStage(null, fn);
}
public CompletableFuture<Void> thenAccept(Consumer<? super T> action) {
return uniAcceptStage(null, action);
}
public CompletableFuture<Void> thenRun(Runnable action) {
return uniRunStage(null, action);
}
public <U,V> CompletableFuture<V> thenCombine(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn) {
return biApplyStage(null, other, fn);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment