AggregatingSignal

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[E, V](loader: () => Future[V], sourceStream: EventStream[E], updater: (V, E) => V)(ec: ExecutionContext): AggregatingSignal[E, V]

Creates a new aggregating signal from the loader which will be used to compute the initial value of the signal, a stream of events, and the updater function which will use those events to update the value of the signal. The loader - which is a future - will be executed in the provided execution context or the default execution context otherwise.

Creates a new aggregating signal from the loader which will be used to compute the initial value of the signal, a stream of events, and the updater function which will use those events to update the value of the signal. The loader - which is a future - will be executed in the provided execution context or the default execution context otherwise.

Type Params
E

The type of the update events.

V

The type of the value held in the signal and the result of the loader execution.

Value Params
ec

The execution context in which the loader is executed (optional).

loader

A future used for computing the initial value of the signal. It's passed by name, so if it is created in the place of argument, it will be executed for the first time only when the first subscriber function is registered in the signal, or immediately if disableAutowiring is used. If a new event comes while the loader not yet finished, the event will be memorized and used to produce the first updated value right afterwards.

sourceStream

An event stream publishing events which will be used to update the value of the signal.

updater

A function combining the current value of the signal with a new event to produce the updated value.

Returns

A new aggregating signal with the value type V.