object Activity extends Serializable
Note: There is a Java-friendly API for this object: com.twitter.util.Activities.
- Alphabetic
- By Inheritance
- Activity
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Failed(exc: Throwable) extends State[Nothing] with Product with Serializable
The activity has failed, with exception
exc
. - case class Ok[T](t: T) extends State[T] with Product with Serializable
The activity is running with a current value of
t
. - sealed trait State[+T] extends AnyRef
An ADT describing the state of an Activity.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[T](states: Event[State[T]]): Activity[T]
Constructs an Activity from a state Event.
- def apply[T](): (Activity[T], Witness[Try[T]])
Create a new pending activity.
Create a new pending activity. The activity's state is updated by the given witness.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collect[T <: AnyRef](activities: List[Activity[T]]): Activity[List[T]]
A Java friendly method for
Activity.collect()
. - def collect[T](acts: Seq[Activity[T]]): Activity[Seq[T]]
Collect a collection of activities into an activity of a collection of values.
Collect a collection of activities into an activity of a collection of values.
def collect[T](activities: Coll[Activity[T]]): Activity[Coll[T]]
Example: - def collectIndependent[T](acts: Seq[Activity[T]]): Activity[Seq[T]]
Collect a collection of activities into an activity of a collection of values.
Collect a collection of activities into an activity of a collection of values. This version relies on Var's collectIndependent, and has the same benefits and drawbacks of that method.
Like Var.collectIndependent this is a workaround and should be deprecated when a version of Var.collect without a stack overflow issue is implemented.
def collectIndependent[T](activities: Coll[Activity[T]]): Activity[Coll[T]]
Example: - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exception(exc: Throwable): Activity[Nothing]
Create a new static activity with exception
exc
. - def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def future[T](f: Future[T]): Activity[T]
Create an activity backed by a com.twitter.util.Future.
Create an activity backed by a com.twitter.util.Future.
The resultant
Activity
is pending until the originalFuture
is satisfied.Future
success or failure corresponds to the expectedActivity.Ok
orActivity.Failed
result.Closure of observations of the
run
Var
of the resultantActivity
is not propagated to the originalFuture
. That is to say, invokingclose()
on observations ofActivity.run
will not result in the cancellation of the originalFuture
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q], r: Activity[R], s: Activity[S], t: Activity[T], u: Activity[U], v: Activity[V]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)]
Join 22 Activities.
Join 22 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q], r: Activity[R], s: Activity[S], t: Activity[T], u: Activity[U]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)]
Join 21 Activities.
Join 21 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q], r: Activity[R], s: Activity[S], t: Activity[T]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)]
Join 20 Activities.
Join 20 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q], r: Activity[R], s: Activity[S]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)]
Join 19 Activities.
Join 19 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q], r: Activity[R]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)]
Join 18 Activities.
Join 18 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P], q: Activity[Q]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)]
Join 17 Activities.
Join 17 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O], p: Activity[P]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)]
Join 16 Activities.
Join 16 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N], o: Activity[O]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)]
Join 15 Activities.
Join 15 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M, N](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M], n: Activity[N]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M, N)]
Join 14 Activities.
Join 14 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L, M](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L], m: Activity[M]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L, M)]
Join 13 Activities.
Join 13 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K, L](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K], l: Activity[L]): Activity[(A, B, C, D, E, F, G, H, I, J, K, L)]
Join 12 Activities.
Join 12 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J, K](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J], k: Activity[K]): Activity[(A, B, C, D, E, F, G, H, I, J, K)]
Join 11 Activities.
Join 11 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I, J](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I], j: Activity[J]): Activity[(A, B, C, D, E, F, G, H, I, J)]
Join 10 Activities.
Join 10 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H, I](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H], i: Activity[I]): Activity[(A, B, C, D, E, F, G, H, I)]
Join 9 Activities.
Join 9 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G, H](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G], h: Activity[H]): Activity[(A, B, C, D, E, F, G, H)]
Join 8 Activities.
Join 8 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F, G](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F], g: Activity[G]): Activity[(A, B, C, D, E, F, G)]
Join 7 Activities.
Join 7 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E, F](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E], f: Activity[F]): Activity[(A, B, C, D, E, F)]
Join 6 Activities.
Join 6 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D, E](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D], e: Activity[E]): Activity[(A, B, C, D, E)]
Join 5 Activities.
Join 5 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C, D](a: Activity[A], b: Activity[B], c: Activity[C], d: Activity[D]): Activity[(A, B, C, D)]
Join 4 Activities.
Join 4 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B, C](a: Activity[A], b: Activity[B], c: Activity[C]): Activity[(A, B, C)]
Join 3 Activities.
Join 3 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- def join[A, B](a: Activity[A], b: Activity[B]): Activity[(A, B)]
Join 2 Activities.
Join 2 Activities. The returned Activity is complete when all underlying Activities are nonpending. It fails immediately if any of them do.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val pending: Activity[Nothing]
A static Activity that is pending.
- def sample[T](act: Activity[T]): T
Sample given
Activity
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def value[T](v: T): Activity[T]
Create a new static activity with value
v
. - final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Pending extends State[Nothing]
The activity is pending output.