play.libs
Class F.Promise<V>

java.lang.Object
  extended by play.libs.F.Promise<V>
All Implemented Interfaces:
java.util.concurrent.Future<V>, F.Action<V>
Direct Known Subclasses:
F.Timeout
Enclosing class:
F

public static class F.Promise<V>
extends java.lang.Object
implements java.util.concurrent.Future<V>, F.Action<V>


Constructor Summary
F.Promise()
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 V get()
           
 V get(long timeout, java.util.concurrent.TimeUnit unit)
           
 V getOrNull()
           
 void invoke(V result)
           
 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>
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)
           
static
<T> F.Promise<java.util.List<T>>
waitAll(java.util.Collection<F.Promise<T>> promises)
           
static
<T> F.Promise<java.util.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>
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

F.Promise

public F.Promise()
Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface java.util.concurrent.Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface java.util.concurrent.Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface java.util.concurrent.Future<V>

getOrNull

public V getOrNull()

get

public V get()
      throws java.lang.InterruptedException,
             java.util.concurrent.ExecutionException
Specified by:
get in interface java.util.concurrent.Future<V>
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

get

public V get(long timeout,
             java.util.concurrent.TimeUnit unit)
      throws java.lang.InterruptedException,
             java.util.concurrent.ExecutionException,
             java.util.concurrent.TimeoutException
Specified by:
get in interface java.util.concurrent.Future<V>
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException

invoke

public void invoke(V result)
Specified by:
invoke in interface F.Action<V>

onRedeem

public void onRedeem(F.Action<F.Promise<V>> callback)

waitAll

public static <T> F.Promise<java.util.List<T>> waitAll(F.Promise<T>... promises)

waitAll

public static <T> F.Promise<java.util.List<T>> waitAll(java.util.Collection<F.Promise<T>> promises)

wait2

public static <A,B> F.Promise<F.Tuple<A,B>> wait2(F.Promise<A> tA,
                                                  F.Promise<B> tB)

wait3

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)

wait4

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)

wait5

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)

waitEither

public static <A,B> F.Promise<F.Either<A,B>> waitEither(F.Promise<A> tA,
                                                        F.Promise<B> tB)

waitEither

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)

waitEither

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)

waitEither

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)

waitAny

public static <T> F.Promise<T> waitAny(F.Promise<T>... futures)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly