glitch-free. If C depends on A and B, and B depends on A, C must consider event A and B's reaction to event A as simultaneous, and react only once.
dynamic topology. A new node can be spawned in reaction to an event in another node. If node B subscribes to node A in reaction to an event in A, the event and the subscription must be considered simultaneous so B must be notified of the event.
support for both discrete and continuous nodes (events and behavior, in original FRP). A discrete node consumes its flow eagerly and propagates backpressure from its subscribers. A continuous node consumes its flow lazily, the current value is sampled when the first subscriber asks for it and the value is then cached for next subscribers until invalidated.
strict supervision. At any time it must be possible to cancel an entire graph. If a node fails, the graph must be cancelled. A graph is terminated when all of its nodes are terminated.
API design :
reactor takes an initializer thunk and returns a task. Running the task evaluates the thunk within a fresh reactor. A node can be spawned only in the dynamic context of a reactor (in the initializer, or in reaction to an event of another node).
stream! and signal! take a flow, spawn a node running this flow (resp. discrete and continuous) and return a flow subscribing to this node.
Rationale : modeling DAG topologies.
Guidelines :
API design :
reactor
takes an initializer thunk and returns a task. Running the task evaluates the thunk within a fresh reactor. A node can be spawned only in the dynamic context of a reactor (in the initializer, or in reaction to an event of another node).stream!
andsignal!
take a flow, spawn a node running this flow (resp. discrete and continuous) and return a flow subscribing to this node.