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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def timeout[A](message: ⇒ A, duration: Long, unit: TimeUnit = TimeUnit.MILLISECONDS)(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 scheduled promise

    returns

    a scheduled promise

  19. 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 scheduled promise

    returns

    a scheduled promise

  20. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def apply[A](): scala.concurrent.Promise[A]

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Use scala.concurrent.Promise() instead.

  2. def pure[A](a: ⇒ A): Future[A]

    Synonym for PurePromise.

    Synonym for PurePromise.apply

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Use scala.concurrent.Future.successful() or scala.concurrent.Promise.complete(Try(...)) instead.

  3. 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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Use scala.concurrent.Future.sequence() instead.

  4. 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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Provide the mapping as required.

  5. 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]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Provide the mapping as required.

  6. 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.

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Provide the mapping as required.

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Provide the mapping as required.

  8. 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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2) Use Promise.timeout(A, Duration) instead.

Inherited from AnyRef

Inherited from Any

Ungrouped