scalaz.concurrent

Promise

class Promise [A] extends () ⇒ A

Represents an expression that is evaluated asynchronously, according to some evaluation strategy.

Attributes
sealed
Source
Promise.scala
Linear Supertypes
() ⇒ A, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Promise
  2. Function0
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Promise ()(implicit strategy: Strategy)

Value Members

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

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. def apply (): A

    Syncrhonously blocks until the value is ready, then returns it.

    Syncrhonously blocks until the value is ready, then returns it. WARNING: May block indefinitely. A kitten dies every time you call this method.

    Definition Classes
    Promise → Function0
  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. def break : Unit

    Breaks the promise.

    Breaks the promise. After this method finishes, any registered continuation will not receive the value. If evaluation has not yet started, it will never start.

  9. def broken : Boolean

    Indicates whether the promise has been broken.

    Indicates whether the promise has been broken. A broken promise is never fulfilled.

  10. def clone (): AnyRef

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

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def errorTo (k: (Throwable) ⇒ Unit): Unit

    Registers the given error handler as a continuation receiving errors thrown by the evaluation.

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

    Returns a promise that is only ever fulfilled if the value of this promise matches the given predicate.

  15. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def flatMap [B] (f: (A) ⇒ Promise[B]): Promise[B]

    Registers the given function as a continuation, returning the result of that function.

  17. def fulfill (a: ⇒ A): Unit

    Sets the value of this promise, out of band.

    Sets the value of this promise, out of band. WARNING: Once the value of a promise is set, it is forever immutable.

  18. def fulfilled : Boolean

    Indicates whether the evaluation of this promise has finished.

  19. def get : A

    Syncrhonously blocks until the value is ready, then returns it.

    Syncrhonously blocks until the value is ready, then returns it. WARNING: May block indefinitely. A kitten dies every time you call this method.

  20. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  21. def hashCode (): Int

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

    Attributes
    final
    Definition Classes
    Any
  23. def map [B] (f: (A) ⇒ B): Promise[B]

    Registers the given function as a continuation, returning a promise of the result.

  24. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  27. def spec [B] (f: (A) ⇒ B, actual: Promise[A])(implicit equality: Equal[A]): Promise[B]

    Speculative concurrency.

    Speculative concurrency. In the expression guess.spec(f, actual) the value of guess is an inexpensive guess at the value and actual is the actual value, usually a more expensive computation. The function f is speculatively applied to the guess. Once the actual value is available, it's compared with the guess. If the guess was correct, we will have already applied f to the correct value, saving time. If the guess was incorrect, then f is applied to the value of actual.

  28. implicit val strategy : Strategy

    Attributes
    implicit
  29. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  30. def threw : Boolean

    Indicates whether the evaluation of this promise threw an error.

  31. def to (k: (A) ⇒ Unit): Unit

    Registers the given actor or effect as a continuation receiving the promised value.

  32. def toString (): String

    Definition Classes
    Promise → Function0 → AnyRef → Any
  33. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from () ⇒ A

Inherited from AnyRef

Inherited from Any