reactive

Batchable

trait Batchable[A, B] extends EventSource[SeqDelta[A, B]]

This EventStream fires SeqDeltas (Seq deltas) and can batch them up.

Source
EventStream.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Batchable
  2. EventSource
  3. Logger
  4. EventStream
  5. Forwardable
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Type Members

  1. class ActorEventStream extends ChildEventSource[T, Unit]

  2. case class AddedForeachListener(listener: (T) ⇒ Unit) extends Product with Serializable

  3. case class AddingListener(listener: (T) ⇒ Unit) extends Product with Serializable

  4. abstract class ChildEventSource[U, S] extends EventSource[U]

  5. class Collected[U] extends ChildEventSource[U, Unit]

  6. case class FiringEvent(event: T, listenersCount: Int, collectedCount: Int) extends Product with Serializable

  7. class FlatMapped[U] extends ChildEventSource[U, Option[EventStream[U]]]

  8. class FoldedLeft[U] extends ChildEventSource[U, U]

  9. case class HasListeners(listeners: List[WeakReference[(T) ⇒ Unit]]) extends Product with Serializable

  10. case class LogEvent(subject: AnyRef, predicate: Any) extends Product with Serializable

  11. class Throttled extends ChildEventSource[T, (Option[T], Long)]

  12. trait LogEventPredicate extends AnyRef

    Annotations
    @deprecated
    Deprecated

    (Since version scala.this.deprecated.init$default$2) No longer needed; predicates can be Any

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. def +=(thunk: (SeqDelta[A, B]) ⇒ Unit)(implicit observing: Observing): EventSource[SeqDelta[A, B]]

    Apply a function for every value.

    Apply a function for every value. Same as =>>.

    Definition Classes
    Forwardable
  5. def ->>(block: ⇒ Unit)(implicit observing: Observing): EventSource[SeqDelta[A, B]]

    Run a block of code for every value

    Run a block of code for every value

    Definition Classes
    Forwardable
  6. def <<:[U >: SeqDelta[A, B], S](target: ⇒ S)(implicit canForward: CanForward[S, U], observing: Observing): S

    Forwards values from this Forwardable to a target, for whose type a CanForward exists (in the implicit scope).

    Forwards values from this Forwardable to a target, for whose type a CanForward exists (in the implicit scope). This operator is available for right associativity. For example: val time = Var(0) <<: timerTicks // equivalent to: val time = Var(0); timerTicks >> time

    returns

    the target

    Definition Classes
    Forwardable
  7. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  9. def =>>(thunk: (SeqDelta[A, B]) ⇒ Unit)(implicit observing: Observing): EventSource[SeqDelta[A, B]]

    Apply a function for every value

    Apply a function for every value

    Definition Classes
    Forwardable
  10. def >>[U >: SeqDelta[A, B], S](target: ⇒ S)(implicit canForward: CanForward[S, U], observing: Observing): EventSource[SeqDelta[A, B]]

    Forwards values from this Forwardable to a target, for whose type a CanForward exists (in the implicit scope).

    Forwards values from this Forwardable to a target, for whose type a CanForward exists (in the implicit scope).

    returns

    the forwarding instance

    Definition Classes
    Forwardable
  11. def ?>>(pf: PartialFunction[SeqDelta[A, B], Unit])(implicit observing: Observing): EventSource[SeqDelta[A, B]]

    Apply a PartialFunction for every applicable value

    Apply a PartialFunction for every applicable value

    Definition Classes
    Forwardable
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. val batch: DynamicVariable[List[SeqDelta[A, B]]]

    Attributes
    protected
  14. def batching[R](p: ⇒ R): R

    Runs code while batching messages.

    Runs code while batching messages. While the code is running, calls to 'fire' on the same thread will not fire messages immediately, but will collect them. When the code completes, the messages are wrapped in a single Batch which is then fired. If there is only one message to be fired it is not wrapped in a Batch but fired directly. Nested calls to batching are ignored, so all messages collected from within the outermost call are collected and they are fired in one batch at the end.

    p

    the code to run

    returns

    the result of evaluating p

  15. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def collect[U](pf: PartialFunction[SeqDelta[A, B], U]): EventStream[U]

    Filter and map in one step.

    Filter and map in one step. Takes a PartialFunction. Whenever an event is received, if the PartialFunction is defined at that event, the value returned by applying it will be fired.

    Definition Classes
    EventSourceEventStream
  17. def debugName: String

    Definition Classes
    EventSourceEventStream
  18. def debugString: String

    Definition Classes
    EventSourceEventStream
  19. def distinct: EventStream[SeqDelta[A, B]]

    Returns a derived EventStream that only fires events that are not equal to the previous event.

    Returns a derived EventStream that only fires events that are not equal to the previous event. This can be used to prevent infinite recursion between multiple event streams that are mutually dependent in a consistent manner.

    Definition Classes
    EventSourceEventStream
  20. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  22. def error(pred: ⇒ Any): Unit

    Log a semantic event at the error level

    Log a semantic event at the error level

    Definition Classes
    Logger
  23. def filter(f: (SeqDelta[A, B]) ⇒ Boolean): EventStream[SeqDelta[A, B]]

    Returns a new EventStream that propagates a subset of the events that this EventStream fires.

    Returns a new EventStream that propagates a subset of the events that this EventStream fires.

    f

    the predicate function that determines which events will be fired by the new EventStream.

    Definition Classes
    EventSourceEventStream
  24. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. def fire(msg: SeqDelta[A, B]): Unit

    Sends an event to all listeners.

    Sends an event to all listeners.

    Definition Classes
    BatchableEventSource
  26. def flatMap[U](f: (SeqDelta[A, B]) ⇒ EventStream[U]): EventStream[U]

    Create a new EventStream that consists of the events of the EventStreams returned by f.

    Create a new EventStream that consists of the events of the EventStreams returned by f. f is applied on every event of the original EventStream, and its returned EventStream is used until the next event fired by the original EventStream, at which time the previously returned EventStream is no longer used and a new one is used instead.

    f

    the function that is applied for every event to produce the next segment of the resulting EventStream.

    Definition Classes
    EventSourceEventStream
  27. def foldLeft[U](initial: U)(f: (U, SeqDelta[A, B]) ⇒ U): EventStream[U]

    Allows one, in a functional manner, to respond to an event while taking into account past events.

    Allows one, in a functional manner, to respond to an event while taking into account past events. For every event t, f is called with arguments (u, t), where u is initially the value of the 'initial' parameter, and subsequently the result of the previous application of f. Returns a new EventStream that, for every event t fired by the original EventStream, fires the result of the application of f (which will also be the next value of u passed to it). Often 'u' will be an object representing some accumulated state. For instance, given an EventStream[Int] named 'es', es.foldLeft(0)(_ + _) would return an EventStream that, for every (integer) event fired by es, would fire the sum of all events that have been fired by es.

    Definition Classes
    EventSourceEventStream
  28. def foreach(f: (SeqDelta[A, B]) ⇒ Unit)(implicit observing: Observing): Unit

    Registers a listener function to run whenever an event is fired.

    Registers a listener function to run whenever an event is fired. The function is held with a WeakReference and a strong reference is placed in the Observing, so the latter determines the function's gc lifetime.

    f

    a function to be applied on every event

    observing

    the object whose gc lifetime should determine that of the function

    Definition Classes
    EventSourceEventStreamForwardable
  29. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  30. def hasListeners: Boolean

    Whether this EventStream has any listeners depending on it

    Whether this EventStream has any listeners depending on it

    Definition Classes
    EventSource
  31. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  32. def hold[U >: SeqDelta[A, B]](init: U): Signal[U]

    Returns a Signal whose value is initially the 'init' parameter, and after every event fired by this EventStream, the value of that event.

    Returns a Signal whose value is initially the 'init' parameter, and after every event fired by this EventStream, the value of that event.

    init

    the initial value of the signal

    Definition Classes
    EventSourceEventStream
  33. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  34. def log(level: Value, pred: ⇒ Any): Unit

    Log a semantic event at the specified level

    Log a semantic event at the specified level

    Definition Classes
    Logger
  35. var logLevel: Value

    Definition Classes
    Logger
  36. def map[U](f: (SeqDelta[A, B]) ⇒ U): EventStream[U]

    Returns a new EventStream, that for every event that this EventStream fires, that one will fire an event that is the result of applying 'f' to this EventStream's event.

    Returns a new EventStream, that for every event that this EventStream fires, that one will fire an event that is the result of applying 'f' to this EventStream's event.

    f

    the function that transforms events fired by this EventStream into events to be fired by the resulting EventStream.

    Definition Classes
    EventSourceEventStream
  37. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. def nonblocking: EventStream[SeqDelta[A, B]]

    Returns a derived event stream in which event propagation does not happen on the thread firing it and block it.

    Returns a derived event stream in which event propagation does not happen on the thread firing it and block it. This is helpful when handling events can be time consuming. The implementation delegates propagation to an actor (scala standard library), so events are handled sequentially.

    Definition Classes
    EventSourceEventStream
  39. def nonrecursive: EventStream[SeqDelta[A, B]]

    Returns a derived EventStream that does not fire events during a prior call to fire on the same thread, thus preventing infinite recursion between multiple event streams that are mutually dependent.

    Returns a derived EventStream that does not fire events during a prior call to fire on the same thread, thus preventing infinite recursion between multiple event streams that are mutually dependent.

    Definition Classes
    EventSourceEventStream
  40. final def notify(): Unit

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

    Definition Classes
    AnyRef
  42. val purgeThreshold: Int

    When n empty WeakReferences are found, purge them

    When n empty WeakReferences are found, purge them

    Attributes
    protected
    Definition Classes
    EventSource
  43. def self: EventSource[SeqDelta[A, B]]

    Definition Classes
    EventSourceEventStreamForwardable
  44. def setLogLevel(level: Value): Batchable.this.type

    Sets the log level and returns the original instance.

    Sets the log level and returns the original instance. So for instance: eventSource.setLogLevel(Logger.Levels.None).fire(mouseEvent) val lessThanTen = eventStream.setLogLevel(Logger.Levels.Trace).filter(_ < 10)

    Definition Classes
    Logger
  45. def subject: Logger

    The subject parameter that LogEvents will be created with

    The subject parameter that LogEvents will be created with

    Definition Classes
    Logger
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def takeWhile(p: (SeqDelta[A, B]) ⇒ Boolean): EventStream[SeqDelta[A, B]]

    Returns a new EventStream that propagates this EventStream's events until the predicate returns false.

    Returns a new EventStream that propagates this EventStream's events until the predicate returns false.

    p

    the precate function, taking an event as its argument and returning true if event propagation should continue

    Definition Classes
    EventSourceEventStream
  48. def throttle(period: Long): EventStream[SeqDelta[A, B]]

    Returns an EventStream that only fires events that are not followed by another event within period milliseconds.

    Returns an EventStream that only fires events that are not followed by another event within period milliseconds. For instance, if you want to display some results in response to the user typing, and you do not want to perform more work than necessary, you may want to wait until the user has not typed anything for a full second.

    Definition Classes
    EventSourceEventStream
  49. def toString(): String

    Definition Classes
    AnyRef → Any
  50. def trace(pred: ⇒ Any): Unit

    Log a semantic event at the trace level

    Log a semantic event at the trace level

    Definition Classes
    Logger
  51. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  54. def warn(pred: ⇒ Any): Unit

    Log a semantic event at the warning level

    Log a semantic event at the warning level

    Definition Classes
    Logger
  55. def zipWithStaleness: EventStream[(SeqDelta[A, B], () ⇒ Boolean)]

    Returns an EventStream whose tuple-valued events include a function for testing staleness.

    Returns an EventStream whose tuple-valued events include a function for testing staleness. The events will be of type (T, ()=>Boolean), where T is the type of the parent event stream; and the tuple will contain the event fired in the parent as well as a function that can be used to test whether that event is outdated because a new event has been fired since then. This is especially useful in conjunction with 'nonblocking', because its actor implementation means that a new event cannot be received until the previous event is finished being handled. The test function is useful because it may be desirable to abort the time-consuming work if a new event has been fired since then. Example usage: for((v, isSuperseded) <- eventStream.zipWithStaleness) { doSomework(); if(!isSuperseded()) doSomeMoreWork() }

    Definition Classes
    EventSourceEventStream
  56. def |[U >: SeqDelta[A, B]](that: EventStream[U]): EventStream[U]

    Union of two EventStreams.

    Union of two EventStreams. Returns a new EventStream that consists of all events fired by both this EventStream and 'that.'

    that

    the other EventStream to combine in the resulting EventStream.

    Definition Classes
    EventSourceEventStream

Deprecated Value Members

  1. var debug: Boolean

    Definition Classes
    EventSource
    Annotations
    @deprecated
    Deprecated

    (Since version scala.this.deprecated.init$default$2) Use logLevel or setLogLevel, this does nothing anymore

  2. def flatMap[U](initial: SeqDelta[A, B])(f: (SeqDelta[A, B]) ⇒ EventStream[U]): EventStream[U]

    Definition Classes
    EventSource
    Annotations
    @deprecated
    Deprecated

    (Since version scala.this.deprecated.init$default$2) Use eventStream.hold(initial).flatMap(f)

Inherited from EventSource[SeqDelta[A, B]]

Inherited from Logger

Inherited from EventStream[SeqDelta[A, B]]

Inherited from Forwardable[SeqDelta[A, B], EventSource[SeqDelta[A, B]]]

Inherited from AnyRef

Inherited from Any