Trait/Object

scala.concurrent

Promise

Related Docs: object Promise | package concurrent

Permalink

trait Promise[T] extends AnyRef

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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Promise
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def future: Future[T]

    Permalink

    Future containing the value of this promise.

  2. abstract def isCompleted: Boolean

    Permalink

    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

    Permalink

    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: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink

    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.

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

    Permalink

    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

  8. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink

    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.

  11. def finalize(): Unit

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

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

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

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

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

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

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

    Permalink

    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.

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

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

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

    Permalink

    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

  22. def tryFailure(cause: Throwable): Boolean

    Permalink

    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.

  23. def trySuccess(value: T): Boolean

    Permalink

    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.

  24. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped