the rate at which to update self
a call-by-name that calculates the signal's value
Returns a derived signal in which value propagation does not happen on the thread triggering the change,
but instead is executed by the provided ExecutionContext
.
Returns a derived signal in which value propagation does not happen on the thread triggering the change,
but instead is executed by the provided ExecutionContext
.
Chained Future
s are used to ensure values are handled sequentially.
Fires an event after every mutation, consisting of the new value
Returns a derived Signal that only fires change events that are not equal to the previous value.
Returns a derived Signal that only fires change events that are not equal to the previous value. This can be used to prevent infinite recursion between multiple signals that are mutually dependent in a consistent manner.
Returns a new Signal or EventStream, that for every value of this parent signal, will correspond to the Signal or EventStream resulting from applying f to the value of the parent signal.
Returns a new Signal or EventStream, that for every value of this parent signal, will correspond to the Signal or EventStream resulting from applying f to the value of the parent signal.
If the function returns a Signal, then whenever this Signal's change EventStream fires, the resulting Signal's change EventStream will fire the value of the new signal, and subsequently will fire all change events fired by that signal. This can be used to build a signal that switches among several other signals. For example: val sa: Signal[Int] = ... def sb(a: Int): Signal[Int] = a.map(_ + 1) val sc = sa.flatMap(a => sb(a))
If the function is typed to return a SeqSignal, its deltas and changes correspond to those of the SeqSignals returned by f, after each invocation of f. In addition, every change to the parent results in a change event as well as deltas reflecting the transition from the SeqSignal previously returned by f and the on returned by it now.
If the function returns an EventStream, then this function returns a new EventStream that corresponds fires the events of whichever EventStream is returns by f for the Signal's current value.
Return a new Signal whose initial value is f(initial, parent.
Return a new Signal whose initial value is f(initial, parent.now). Whenever the parent's value changes, the signal's value changes to f(previous, parent.now)
Return a new Signal whose value is computed from the value of this Signal, transformed by f.
Return a new Signal whose value is computed from the value of this Signal, transformed by f. It fires change events whenever (and only when) the original Signal does, but the event values are transformed by f.
For example:
val a: Signal[Int] = ... val b = a.map(_ + 1)b represents a Signal whose value is always 1 greater than a. Whenever a fires an event of x, b fires an event of x+1.
Returns a derived signal in which value propagation does not happen on the thread triggering the change,
but instead is executed by the global ExecutionContext
.
Returns a derived signal in which value propagation does not happen on the thread triggering the change,
but instead is executed by the global ExecutionContext
.
Chained Future
s are used to ensure values are handled sequentially.
Returns a derived Signal that does not fire change events during a prior call to fire on the same thread, thus preventing infinite recursion between multiple signals that are mutually dependent in an inconsistent manner.
Returns a derived Signal that does not fire change events during a prior call to fire on the same thread, thus preventing infinite recursion between multiple signals that are mutually dependent in an inconsistent manner. For instance, if two Vars have a bidirectionally-enforced mathematical relationship that can produce rounding errors.
Represents the current value.
Return a new Signal whose initial value is parent.
Return a new Signal whose initial value is parent.now. Whenever the parent's value changes, the signal's value changes to f(previous, parent.now)
[use case]
a signal whose value is a List of all the values of the signals contained in this signal, updated whenever either this signal changes or any of the contained signals change.
Usage: var()=x
Usage: var()=x
Setter.
Setter. Usage: var.value = x
Returns a Tuple2-valued Signal that contains the values of this Signal and another Signal
Returns a Tuple2-valued Signal that contains the values of this Signal and another Signal
the other Signal
the Tuple2-valued Signal
Returns a tuple-valued Signal whose value includes a function for testing staleness.
Returns a tuple-valued Signal whose value includes a function for testing staleness. The signal will hold values of type (T, ()=>Boolean), where T is the type of the parent signal, and the value tuple will contain the parent's value at the last time it was received, as well as a function that can be used to test whether that value is outdated because the parent has received a new value. This is especially useful in conjunction with 'nonblocking', because its actor implementation means that a new value cannot be received until the previous value is finished being handled. The test function is useful because it may be desirable to abort time-consuming work if the value has been superseded Example usage: for((v, isSuperseded) <- signal.zipWithStaleness) { doSomework(); if(!isSuperseded()) doSomeMoreWork() }
A Var that updates itself based on the supplied call-by-name regularly, at a given interval, on a java.util.Timer thread.