play.api.libs.concurrent

PlayPromise

class PlayPromise[+A] extends AnyRef

A promised value that wraps around scala.concurent.Future. The value of the promise is to be computed asynchronously. The promise will be completed either with the expected value type or with an exception.

Source
Promise.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PlayPromise
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PlayPromise(fu: Future[A])

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def await(timeout: Long, unit: TimeUnit = TimeUnit.MILLISECONDS): NotWaiting[A]

    Blocks for a specified timeout until the promise has a value or an exception; throws java.

    Blocks for a specified timeout until the promise has a value or an exception; throws java.util.concurrent.TimeoutException if the promise is not redeemed in time. Unlike Await.result() in Akka, does NOT throw an exception from the Promise itself.

  8. def await: NotWaiting[A]

    Blocks for Promise.

    Blocks for Promise.defaultTimeout until the promise has a value or an exception; throws java.util.concurrent.TimeoutException if the promise is not redeemed within the default timeout period. Unlike Await.result() in Akka, does NOT throw an exception from the Promise itself.

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def extend[B](k: (Future[A]) ⇒ B)(implicit ec: ExecutionContext): Future[B]

    Creates a new Promise[B], by running the function k on this promise after it is redeemed with a value or exception.

    Creates a new Promise[B], by running the function k on this promise after it is redeemed with a value or exception. The function may run in another thread. extend() is similar to map() but can modify an exception contained in the promise, not only a successful value.

    k

    function to be executed on this promise

  13. def extend1[B](k: (NotWaiting[A]) ⇒ B)(implicit ec: ExecutionContext): Future[B]

    Like extend() but gives your function the promise's value rather than the promise itself.

    Like extend() but gives your function the promise's value rather than the promise itself.

    k

    function to be executed on this promise

  14. def filter(p: (A) ⇒ Boolean): Future[A]

    Computes a new Promise which will be completed with NoSuchElementException if the value of this promise does not match the given predicate.

    Computes a new Promise which will be completed with NoSuchElementException if the value of this promise does not match the given predicate. The predicate may be run in another thread.

    p

    predicate

  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def onRedeem(k: (A) ⇒ Unit)(implicit ec: ExecutionContext): Unit

    Registers a callback to be invoked when (and if) the promise is completed with a non-exception value.

    Registers a callback to be invoked when (and if) the promise is completed with a non-exception value. The callback may run in another thread.

    k

    the callback

  23. def or[B](other: Future[B]): Future[Either[A, B]]

    Returns a Promise representing the first-completed of this promise or another promise.

    Returns a Promise representing the first-completed of this promise or another promise. The resulting Promise contains either Left(resultOfThisPromise), Right(resultOfOtherPromise), or an exception which could be from either of the two promises.

    other

    promise to be composed with

  24. def orTimeout(e: Throwable): Future[A]

    Creates a timer promise with Throwable e (using the deafult Promise timeout).

    Creates a timer promise with Throwable e (using the deafult Promise timeout). Exception e is shown if timer promise redeemds first

    e

    exception to be thrown

    returns

    a Promise which may throw an exception

  25. def orTimeout[B](message: B): Future[Either[A, B]]

    Creates a timer promise with the given message (using the deafult Promise timeout).

    Creates a timer promise with the given message (using the deafult Promise timeout). Message a is shown if the timer promise redeems before the current promise

    message

    message to be displayed if the timer promise redeems first

    returns

    either the timer message or the current promise

  26. def orTimeout[B](message: ⇒ B, duration: Long, unit: TimeUnit)(implicit ec: ExecutionContext): Future[Either[A, B]]

    Creates a timer promise with the given message.

    Creates a timer promise with the given message. Message a is shown if the timer promise redeems before the current promise

    message

    message to be displayed if the timer promise redeems first

    duration

    duration

    returns

    either the timer message or the current promise

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. def value1: NotWaiting[A]

    Synonym for await, blocks for the promise to be completed with a value or an exception.

  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any

Ungrouped