Modifier and Type | Field and Description |
---|---|
protected List<F.Action<F.Promise<V>>> |
callbacks |
protected boolean |
cancelled |
protected Throwable |
exception |
protected boolean |
invoked |
protected V |
result |
protected CountDownLatch |
taskLock |
Constructor and Description |
---|
Promise() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
V |
getOrNull() |
void |
invoke(V result) |
void |
invokeWithException(Throwable t) |
protected void |
invokeWithResultOrException(V result,
Throwable t) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
onRedeem(F.Action<F.Promise<V>> callback) |
static <A,B> F.Promise<F.Tuple<A,B>> |
wait2(F.Promise<A> tA,
F.Promise<B> tB) |
static <A,B,C> F.Promise<F.T3<A,B,C>> |
wait3(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC) |
static <A,B,C,D> F.Promise<F.T4<A,B,C,D>> |
wait4(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC,
F.Promise<D> tD) |
static <A,B,C,D,E> |
wait5(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC,
F.Promise<D> tD,
F.Promise<E> tE) |
static <T> F.Promise<List<T>> |
waitAll(Collection<F.Promise<T>> promises) |
static <T> F.Promise<List<T>> |
waitAll(F.Promise<T>... promises) |
static <T> F.Promise<T> |
waitAny(F.Promise<T>... futures) |
static <A,B> F.Promise<F.Either<A,B>> |
waitEither(F.Promise<A> tA,
F.Promise<B> tB) |
static <A,B,C> F.Promise<F.E3<A,B,C>> |
waitEither(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC) |
static <A,B,C,D> F.Promise<F.E4<A,B,C,D>> |
waitEither(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC,
F.Promise<D> tD) |
static <A,B,C,D,E> |
waitEither(F.Promise<A> tA,
F.Promise<B> tB,
F.Promise<C> tC,
F.Promise<D> tD,
F.Promise<E> tE) |
protected final CountDownLatch taskLock
protected boolean cancelled
protected boolean invoked
protected V result
protected Throwable exception
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V getOrNull()
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public void invokeWithException(Throwable t)
public static <T> F.Promise<List<T>> waitAll(Collection<F.Promise<T>> promises)
public static <A,B,C> F.Promise<F.T3<A,B,C>> wait3(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC)
public static <A,B,C,D> F.Promise<F.T4<A,B,C,D>> wait4(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC, F.Promise<D> tD)
public static <A,B,C,D,E> F.Promise<F.T5<A,B,C,D,E>> wait5(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC, F.Promise<D> tD, F.Promise<E> tE)
public static <A,B> F.Promise<F.Either<A,B>> waitEither(F.Promise<A> tA, F.Promise<B> tB)
public static <A,B,C> F.Promise<F.E3<A,B,C>> waitEither(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC)
public static <A,B,C,D> F.Promise<F.E4<A,B,C,D>> waitEither(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC, F.Promise<D> tD)
public static <A,B,C,D,E> F.Promise<F.E5<A,B,C,D,E>> waitEither(F.Promise<A> tA, F.Promise<B> tB, F.Promise<C> tC, F.Promise<D> tD, F.Promise<E> tE)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly