public class PgxFuture<T>
extends jsr166e.CompletableFuture<T>
CompletableFuture
jsr166e.CompletableFuture.Action<A>, jsr166e.CompletableFuture.AsynchronousCompletionTask, jsr166e.CompletableFuture.BiAction<A,B>, jsr166e.CompletableFuture.BiFun<A,B,T>, jsr166e.CompletableFuture.Fun<A,T>, jsr166e.CompletableFuture.Generator<T>
Constructor and Description |
---|
PgxFuture() |
Modifier and Type | Method and Description |
---|---|
static <T> PgxFuture<java.lang.Void> |
allOf(java.util.List<PgxFuture<T>> promises) |
boolean |
cancel() |
PgxFuture<T> |
cancelOn(PgxFuture promise)
If given promise completes exceptionally because it was canceled,
cancel() gets called on this promise as well. |
static <T> PgxFuture<T> |
completedFuture(T arg) |
static <T> PgxFuture<T> |
exceptionallyCompletedFuture(java.lang.Throwable th) |
T |
get() |
T |
get(long timeout, java.util.concurrent.TimeUnit unit) |
T |
getNow(T valueIfAbsent) |
boolean |
isConsumed() |
T |
join() |
PgxFuture<java.lang.Void> |
thenAccept(jsr166e.CompletableFuture.Action<? super T> block) |
<U> PgxFuture<U> |
thenApply(jsr166e.CompletableFuture.Fun<? super T,? extends U> fn) |
<U,V> PgxFuture<V> |
thenCombine(jsr166e.CompletableFuture<? extends U> other, jsr166e.CompletableFuture.BiFun<? super T,? super U,? extends V> fn) |
PgxFuture<T> |
thenComplete(PgxFuture<T> promise)
completes the given promise whenever this completes.
|
PgxFuture<T> |
thenComplete(PgxFuture<T> promise, java.lang.Runnable cleanup)
completes the given promise whenever this completes.
|
<U> PgxFuture<U> |
thenCompose(jsr166e.CompletableFuture.Fun<? super T,jsr166e.CompletableFuture<U>> fn) |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeExceptionally, exceptionally, getNumberOfDependents, handle, isCancelled, isDone, obtrudeException, obtrudeValue, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApplyAsync, thenApplyAsync, thenCombineAsync, thenCombineAsync, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toString
public boolean cancel()
public PgxFuture<T> cancelOn(PgxFuture promise)
cancel()
gets called on this promise as well.promise
- If given promise completes exceptionally because it was canceled, cancel()
gets called on this promise as well. If given promise completes exceptionally (regardless of the causing exception) and this promise has started or is done, rollback()
gets called on this promise.public static <T> PgxFuture<T> completedFuture(T arg)
public static <T> PgxFuture<T> exceptionallyCompletedFuture(java.lang.Throwable th)
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
public T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
public boolean isConsumed()
public PgxFuture<java.lang.Void> thenAccept(jsr166e.CompletableFuture.Action<? super T> block)
thenAccept
in class jsr166e.CompletableFuture<T>
public <U> PgxFuture<U> thenApply(jsr166e.CompletableFuture.Fun<? super T,? extends U> fn)
thenApply
in class jsr166e.CompletableFuture<T>
public <U,V> PgxFuture<V> thenCombine(jsr166e.CompletableFuture<? extends U> other, jsr166e.CompletableFuture.BiFun<? super T,? super U,? extends V> fn)
thenCombine
in class jsr166e.CompletableFuture<T>
public PgxFuture<T> thenComplete(PgxFuture<T> promise)
If this completes exceptionally, the given promise is completed exceptionally as well.
promise
- the promisepublic PgxFuture<T> thenComplete(PgxFuture<T> promise, java.lang.Runnable cleanup)
If this completes exceptionally, the given promise is completed exceptionally as well.
promise
-cleanup
- to be run upon completion (can be null)Copyright © 2016, 2017 Oracle Corp. All Rights Reserved.