play.api.libs.concurrent

Promise

object Promise

useful helper methods to create and compose Promises

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

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. def apply[A](): scala.concurrent.Promise[A]

    Constructs a new redeemable Promise which has not been redeemed yet.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

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

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

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

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

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

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

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

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

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

    Definition Classes
    AnyRef
  18. def pure[A](a: ⇒ A): Future[A]

    Synonym for PurePromise.

    Synonym for PurePromise.apply

  19. def sequence[B, M[_]](in: M[Future[B]])(implicit toTraversableLike: (M[Future[B]]) ⇒ TraversableLike[Future[B], M[Future[B]]], cbf: CanBuildFrom[M[Future[B]], B, M[B]]): Future[M[B]]

    Converts a traversable type M containing a Promise, into a Promise containing type M.

    Converts a traversable type M containing a Promise, into a Promise containing type M. For example you could convert a List of Promise into a Promise of a List.

    in

    the traversable that's being converted into a promise

    returns

    a Promise that's the result of the transformation

  20. def sequence[A](in: Option[Future[A]]): Future[Option[A]]

    Converts an optional promise into a promise containing an optional value.

    Converts an optional promise into a promise containing an optional value. i.e. if the original option is None, you get a Future[Option[A]] with a value of None, if the original option is Some, you get a Future[Option[A]] containing Some(A). Called "sequence" because its more general form (see below) can operate on multi-element collections such as lists.

  21. def sequenceEither[A, B](e: Either[A, Future[B]]): Future[Either[A, B]]

    Converts an either containing a Promise as its Right into a Promise of an Either with a plain (not-in-a-promise) value on the Right.

    Converts an either containing a Promise as its Right into a Promise of an Either with a plain (not-in-a-promise) value on the Right.

    returns

    a promise with Either[A,B]

  22. def sequenceEither1[A, B](e: Either[Future[A], Future[B]]): Future[Either[A, B]]

    Converts an either containing a Promise on both Left and Right into a Promise of an Either with plain (not-in-a-promise) values.

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

    Definition Classes
    AnyRef
  24. def timeout: Future[Nothing]

    Constructs a promise which will contain value "message" after the given duration elapses.

    Constructs a promise which will contain value "message" after the given duration elapses. This is useful only when used in conjunction with other Promises.

    returns

    a timer promise

  25. def timeout[A](message: ⇒ A, duration: Long, unit: TimeUnit)(implicit ec: ExecutionContext): Future[A]

    Constructs a promise which will contain value "message" after the given duration elapses.

    Constructs a promise which will contain value "message" after the given duration elapses. This is useful only when used in conjunction with other Promises

    message

    message to be displayed

    duration

    duration for the timer promise

    returns

    a timer promise

  26. def timeout[A](message: ⇒ A, duration: Duration)(implicit ec: ExecutionContext): Future[A]

    Constructs a promise which will contain value "message" after the given duration elapses.

    Constructs a promise which will contain value "message" after the given duration elapses. This is useful only when used in conjunction with other Promises

    message

    message to be displayed

    duration

    duration for the timer promise

    returns

    a timer promise

  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def sequenceOption[A](o: Option[Future[A]]): Future[Option[A]]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.1) use sequence instead

Inherited from AnyRef

Inherited from Any

Ungrouped