Object/Class

com.twitter.util

Promise

Related Docs: class Promise | package util

Permalink

object Promise

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

Type Members

  1. trait Detachable extends AnyRef

    Permalink

    A template trait for Promises that are derived and capable of being detached from other Promises.

  2. case class ImmutableResult(message: String) extends Exception with Product with Serializable

    Permalink

    Indicates that an attempt to satisfy a com.twitter.util.Promise was made after that promise had already been satisfied.

  3. trait InterruptHandler extends PartialFunction[Throwable, Unit]

    Permalink

    Embeds an "interrupt handler" into a Promise.

    Embeds an "interrupt handler" into a Promise.

    This is a total handler such that it's defined on any Throwable. Use Promise.setInterruptHandler() if you need to leave an interrupt handler undefined for certain types of exceptions.

    Example: (p and q are equivalent, but p allocates less):

    import com.twitter.util.Promise
    
    val p = new Promise[A] with Promise.InterruptHandler {
      def onInterrupt(t: Throwable): Unit = setException(t)
    }
    
    val q = new Promise[A]
    q.setInterruptHandler { case t: Throwable => q.setException(t) }
    Note

    Later calls to setInterruptHandler on a promise mixing in this trait will replace the embedded handler.

  4. sealed trait Responder[A] extends AnyRef

    Permalink

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

    Permalink

    Create a new, empty, promise of type {{A}}.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def attached[A](parent: Future[A]): Promise[A] with Detachable

    Permalink

    Create a derivative promise that will be satisfied with the result of the parent.

    Create a derivative promise that will be satisfied with the result of the parent.

    If the derivative promise is detached before the parent is satisfied, then it becomes disconnected from the parent and can be used as a normal, unlinked Promise.

    By the contract of Detachable, satisfaction of the Promise must occur after detachment. Promises should only ever be satisfied after they are successfully detached (thus satisfaction is the responsibility of the detacher).

    Ex:

    val f: Future[Unit]
    val p: Promise[Unit] with Detachable = Promise.attached(f)
    ...
    if (p.detach()) p.setValue(())
  7. def clone(): AnyRef

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def interrupts[A](fs: Future[_]*): Promise[A]

    Permalink

    Create a promise that interrupts all of fs.

    Create a promise that interrupts all of fs. In particular: the returned promise handles an interrupt when any of fs do.

    See also

    Future)

    interrupts(Future)

  14. def interrupts[A](a: Future[_], b: Future[_]): Promise[A]

    Permalink

    Create a promise that interrupts a and b futures.

    Create a promise that interrupts a and b futures. In particular: the returned promise handles an interrupt when either a or b does.

    See also

    interrupts(Future*)

    interrupts(Future)

  15. def interrupts[A](f: Future[_]): Promise[A]

    Permalink

    Single-arg version to avoid object creation and take advantage of forwardInterruptsTo.

    Single-arg version to avoid object creation and take advantage of forwardInterruptsTo.

    See also

    interrupts(Future*)

    Future)

  16. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped