the value this signal counts up from. Defaults to 0.
the frequency at which to update the signal's value. Defaults to 1 second.
a function called with each tick that should return true to terminate the timer. By default it will never terminate.
(Since version 0.4.0) Use reactive.logging.LogEvent
Returns a derived event stream in which event propagation does not happen on the thread firing
the event, but instead is executed by the provided ExecutionContext
.
Returns a derived event stream in which event propagation does not happen on the thread firing
the event, but instead is executed by the provided ExecutionContext
.
Chained Future
s are used to ensure the propagation happens sequentially.
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.
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.
Log a semantic event at the error level
Log a semantic event at the error level
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.
the predicate function that determines which events will be fired by the new EventStream.
Sends an event to all listeners.
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.
the function that is applied for every event to produce the next segment of the resulting EventStream.
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.
Registers a listener function to run whenever an event is fired.
Registers a listener function to run whenever
an event is fired. The function may be held in a WeakReference
.
A strong reference is placed in the Observing
, so
if the Observing
is garbage collected,
the listener may be as well.
a function to be applied on every event
the object whose gc lifetime should determine that of the function
Whether this EventStream has any listeners depending on it
Whether this EventStream has any listeners depending on it
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.
the initial value of the signal
Log a semantic event at the specified level
Log a semantic event at the specified level
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.
the function that transforms events fired by this EventStream into events to be fired by the resulting EventStream.
Returns a derived event stream in which event propagation does not happen on the thread firing
the event, but instead is executed by the global ExecutionContext
.
Returns a derived event stream in which event propagation does not happen on the thread firing
the event, but instead is executed by the global ExecutionContext
.
Chained Future
s are used to ensure the propagation happens sequentially.
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.
When n empty WeakReferences are found, purge them
When n empty WeakReferences are found, purge them
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)
The subject parameter that LogEvents will be created with
The subject parameter that LogEvents will be created with
Registers a listener function to run whenever an event is fired, and a returns a Subscription that can be used to remove the listener.
Registers a listener function to run whenever
an event is fired, and a returns a Subscription
that can be used to remove the listener.
The function may be held in a WeakReference
.
A strong reference is placed in the Subscription
, so
the Subscription
is garbage collected,
the listener may be as well.
a function to be applied on every event
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.
the precate function, taking an event as its argument and returning true if event propagation should continue
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.
Log a semantic event at the trace level
Log a semantic event at the trace level
Converts this EventStream of Either
s into two EventStreams of the
Left
and Right
halves, respectively.
Converts this EventStream of Either
s into two EventStreams of the
Left
and Right
halves, respectively. For each Left
event that
this EventStream fires, the first of the returned streams will fire
the data inside of that Left
. Similarly, for each Right
event
that this EventStream fires, the second of the returned streams will
fire the data inside of that Right
.
Converts this EventStream of pairs into two EventStreams of the first and second half of each pair.
Converts this EventStream of pairs into two EventStreams of the first and second half of each pair. For each event that this EventStream fires, the returned event streams will fire the first half and second half of that event, respectively.
Log a semantic event at the warning level
Log a semantic event at the warning level
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() }
Union of two EventStreams.
Union of two EventStreams. Returns a new EventStream that consists of all events fired by both this EventStream and 'that.'
the other EventStream to combine in the resulting EventStream.
(Since version 0.4.0) Use reactive.logging.LogEvent
(Since version 0.2) Use eventStream.hold(initial).flatMap(f)
An EventStream that fires events at the given interval. Event values are (delta time in milliseconds) + startValue There is no guarantee that the delta will be a multiple of interval, of course Events are fired on a java.util.Timer thread