A reactive emitter that can be used with the mutate
block.
The default implementation of a reactive value.
A reactive value that can programatically emit events.
A base trait for reactives that never emit events.
The proxy reactive that emits events of its underlying reactive.
Unsubscribes by calling unsubscribe
on the underlying subscription.
A subscription to a certain kind of event, event processing or computation in general.
Unsubscribing will call unsubscribe
on all the
subscriptions in ss
.
Unsubscribing will call unsubscribe
on all the
subscriptions in ss
.
the child subscriptions
the composite subscription
A reactive that never emits events.
A reactive that never emits events.
type of events in this reactive
Contains factory methods for subscription.
Defines a new passive reactive that emits several events to any new subscriber.
Defines a new passive reactive that emits several events to any new subscriber.
type of the events to emit
events to emit
a reactive that emits the specified events
Creates a new reactive that invokes the function f
on any Reactor
that subscribes to it.
Creates a new reactive that invokes the function f
on any Reactor
that subscribes to it.
Passive reactives usually emit separate event streams to each reactor
for which onReaction
has been called.
Once all the events are emitted, clients should call unreact
to notify
the reactor that there will be no more events.
Example:
val r = passive[Int] { reactor => reactor.react(1) reactor.react(2) reactor.unreact() }
Never use passive
to install adapt a callback in a 3rd party API.
For example, *never* do this:
val r = passive[String] { reactor => Future { "... " * 5 + "done!" } onSuccess { case e => reactor.react(e); reactor.unreact() } } val m = Signal.Mutable(mutable.ArrayBuffer[String]()) val s1 = r.onEvent(e => m += e) val s2 = r.onEvent(e => m += e)
Above, subscriptions s1
and s2
could execute concurrenctly and corrupt the buffer.
type of the events in this passive reactive
function to execute on any newly subscribed reactor
the passive reactive defined by f
You should never use this method to bind reactors to bind reactors to custom callbacks in 3rd party APIs. Those callbacks may execute on another thread, and that is *unsafe*.
Defines a new passive reactive that emits a single event to any new subscriber.
Defines a new passive reactive that emits a single event to any new subscriber.
type of the event to emit
event to emit
a reactive that emits a single event
Contains useful
Reactive
implementations and factory methods.