com.twitter.util

Event

trait Event[+T] extends AnyRef

Events are instantaneous values, defined only at particular instants in time (cf. Vars, which are defined at all times). It is possible to view Events as the discrete counterpart to Var's continuous nature.

Events are observed by registering com.twitter.util.Witness Witnesss to which the Event's values are notified.

Self Type
Event[T]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Event
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def register(s: Witness[T]): Closable

    Register the given Witness to this Event.

    Register the given Witness to this Event. Witnesses are notified of new values until it is deregistered by the returned Closable.

Concrete Value Members

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

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

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

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def build[U >: T, That](implicit cbf: CanBuild[U, That]): Event[That]

    Progressively build a collection of events using the passed-in builder.

    Progressively build a collection of events using the passed-in builder. A value containing the current version of the collection is notified for each incoming event.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collect[U](f: PartialFunction[T, U]): Event[U]

    Build a new Event by applying the given function to each value notified.

    Build a new Event by applying the given function to each value notified. Event values for which the partial function f does not apply are dropped; other values are transformed by f.

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

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

    Definition Classes
    AnyRef → Any
  12. def filter(p: (T) ⇒ Boolean): Event[T]

    Build a new Event by keeping only those Event values that match the predicate p.

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def foldLeft[U](z: U)(f: (U, T) ⇒ U): Event[U]

    Build a new Event by incrementally accumulating over events, starting with value z.

    Build a new Event by incrementally accumulating over events, starting with value z. Each intermediate aggregate is notified to the derived event.

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

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

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

    Definition Classes
    Any
  18. def joinLast[U](other: Event[U]): Event[(T, U)]

    Join two events into a new Event which notifys a tuple of the last value in each underlying event.

  19. def map[U](f: (T) ⇒ U): Event[U]

    Build a new Event by transforming each new event value with f.

  20. def merge[U >: T](other: Event[U]): Event[U]

    Merge two events; the resulting event interleaves events from this and other.

  21. def mergeMap[U](f: (T) ⇒ Event[U]): Event[U]

    The Event which merges the events resulting from f applied to each element in this Event.

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

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def respond(s: (T) ⇒ Unit): Closable

    Observe this event with function f.

    Observe this event with function f. Equivalent to register(Witness(f)).

  26. def select[U](other: Event[U]): Event[Either[T, U]]

    Merge two Events of different types.

  27. def sliding(n: Int): Event[Seq[T]]

    Build a new Event representing a sliding window of at-most n.

    Build a new Event representing a sliding window of at-most n. Each event notified by the parent are added to a queue of size at-most n. This queue is in turn notified to register of the returned event.

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

    Definition Classes
    AnyRef
  29. def take(howmany: Int): Event[T]

    An event which consists of the first howmany values in the parent Event.

  30. def toFuture(): Future[T]

    A Future which is satisfied by the first value observed.

  31. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def zip[U](other: Event[U]): Event[(T, U)]

    Merge two event streams in lock-step, combining corresponding event values.

    Merge two event streams in lock-step, combining corresponding event values.

    Note

    This can be dangerous! Since the implementation needs to queue outstanding Event-values from the slower producer, if one Event outpaces another, this queue can grow in an unbounded fashion.

Inherited from AnyRef

Inherited from Any

Ungrouped