Class/Object

com.twitter.util

Activity

Related Docs: object Activity | package util

Permalink

case class Activity[+T](run: Var[State[T]]) extends Product with Serializable

An Activity is a handle to a concurrently running process, producing T-typed values. An activity is in one of three states:

An activity may transition between any state at any time.

(The observant reader will notice that this is really a monad transformer for an Op monad over Var where Op is like a Try with an additional pending state.)

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Activity
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Activity(run: Var[State[T]])

    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. 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 collect[U](f: PartialFunction[T, U]): Activity[U]

    Permalink

    Build a new activity by applying f to each value.

    Build a new activity by applying f to each value. When f is not defined for this activity's current value, the derived activity becomes pending.

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

    Permalink
    Definition Classes
    AnyRef
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def flatMap[U](f: (T) ⇒ Activity[U]): Activity[U]

    Permalink

    The activity which behaves as f applied to Ok values.

  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def handle[U >: T](h: PartialFunction[Throwable, U]): Activity[U]

    Permalink

    Recover a failed activity.

  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def join[U](that: Activity[U]): Activity[(T, U)]

    Permalink

    Join two activities.

  14. def map[U](f: (T) ⇒ U): Activity[U]

    Permalink

    Map a T-typed activity to a U-typed one.

  15. def mapState[U](f: (State[T]) ⇒ State[U]): Activity[U]

    Permalink

    Map the states of a T-typed activity to a U-typed one.

  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. val run: Var[State[T]]

    Permalink
  20. def sample(): T

    Permalink

    Sample the current value of this activity.

    Sample the current value of this activity. Sample throws an exception if the activity is in pending state or has failed.

  21. def stabilize: Activity[T]

    Permalink

    Stabilize the value of this activity such that once an Ok value has been returned it stops error propagation and instead returns the last Ok value.

  22. def states: Event[State[T]]

    Permalink

    An Event of states.

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

    Permalink
    Definition Classes
    AnyRef
  24. def transform[U](f: (State[T]) ⇒ Activity[U]): Activity[U]

    Permalink

    The activity which behaves as f to the state of this activity.

  25. def values: Event[Try[T]]

    Permalink

    An Event containing only nonpending values.

  26. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped