scala.concurrent

Promise

trait Promise[T] extends AnyRef

Promise is an object which can be completed with a value or failed with an exception.

Source
Promise.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Promise
  2. AnyRef
  3. Any
Implicitly
  1. by StringAdd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def future: Future[T]

    Future containing the value of this promise.

  2. abstract def isCompleted: Boolean

    Returns whether the promise has already been completed with a value or an exception.

    Returns whether the promise has already been completed with a value or an exception.

    Note: Using this method may result in non-deterministic concurrent programs.

    returns

    true if the promise is already completed, false otherwise

  3. abstract def tryComplete(result: Try[T]): Boolean

    Tries to complete the promise with either a value or the exception.

    Tries to complete the promise with either a value or the exception.

    Note: Using this method may result in non-deterministic concurrent programs.

    returns

    If the promise has already been completed returns false, or true otherwise.

Concrete 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. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Promise[T] to StringAdd[Promise[T]] performed by method StringAdd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (Promise[T], B)

    Implicit information
    This member is added by an implicit conversion from Promise[T] to ArrowAssoc[Promise[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def complete(result: Try[T]): Promise.this.type

    Completes the promise with either an exception or a value.

    Completes the promise with either an exception or a value.

    result

    Either the value or the exception to complete the promise with.

    If the promise has already been fulfilled, failed or has timed out, calling this method will throw an IllegalStateException.

  11. final def completeWith(other: Future[T]): Promise.this.type

    Completes this promise with the specified future, once that future is completed.

    Completes this promise with the specified future, once that future is completed.

    returns

    This promise

  12. def ensuring(cond: (Promise[T]) ⇒ Boolean, msg: ⇒ Any): Promise[T]

    Implicit information
    This member is added by an implicit conversion from Promise[T] to Ensuring[Promise[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (Promise[T]) ⇒ Boolean): Promise[T]

    Implicit information
    This member is added by an implicit conversion from Promise[T] to Ensuring[Promise[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): Promise[T]

    Implicit information
    This member is added by an implicit conversion from Promise[T] to Ensuring[Promise[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): Promise[T]

    Implicit information
    This member is added by an implicit conversion from Promise[T] to Ensuring[Promise[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  18. def failure(cause: Throwable): Promise.this.type

    Completes the promise with an exception.

    Completes the promise with an exception.

    cause

    The throwable to complete the promise with.

    If the throwable used to fail this promise is an error, a control exception or an interrupted exception, it will be wrapped as a cause within an ExecutionException which will fail the promise.

    If the promise has already been fulfilled, failed or has timed out, calling this method will throw an IllegalStateException.

  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Returns string formatted according to given format string.

    Returns string formatted according to given format string. Format strings are as for String.format (@see java.lang.String.format).

    Implicit information
    This member is added by an implicit conversion from Promise[T] to StringFormat[Promise[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

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

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

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

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

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

    Definition Classes
    AnyRef
  27. def success(value: T): Promise.this.type

    Completes the promise with a value.

    Completes the promise with a value.

    value

    The value to complete the promise with.

    If the promise has already been fulfilled, failed or has timed out, calling this method will throw an IllegalStateException.

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

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. final def tryCompleteWith(other: Future[T]): Promise.this.type

    Attempts to complete this promise with the specified future, once that future is completed.

    Attempts to complete this promise with the specified future, once that future is completed.

    returns

    This promise

  31. def tryFailure(cause: Throwable): Boolean

    Tries to complete the promise with an exception.

    Tries to complete the promise with an exception.

    Note: Using this method may result in non-deterministic concurrent programs.

    returns

    If the promise has already been completed returns false, or true otherwise.

  32. def trySuccess(value: T): Boolean

    Tries to complete the promise with a value.

    Tries to complete the promise with a value.

    Note: Using this method may result in non-deterministic concurrent programs.

    returns

    If the promise has already been completed returns false, or true otherwise.

  33. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def [B](y: B): (Promise[T], B)

    Implicit information
    This member is added by an implicit conversion from Promise[T] to ArrowAssoc[Promise[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion StringAdd from Promise[T] to StringAdd[Promise[T]]

Inherited by implicit conversion StringFormat from Promise[T] to StringFormat[Promise[T]]

Inherited by implicit conversion Ensuring from Promise[T] to Ensuring[Promise[T]]

Inherited by implicit conversion ArrowAssoc from Promise[T] to ArrowAssoc[Promise[T]]

Ungrouped