aarondb/reactive
Types
Local reactive subscriptions are serialized by this actor.
Notifications are processed in the order this actor receives them. Each affected live subscriber receives at most one complete delta per notification, after its initial result. Delivery uses ordinary BEAM mailboxes: sends never block a writer and there is no hidden queue, dropping, or flow control. Consumers must drain their own mailbox; a stopped subscriber is removed on the next notification.
pub type ReactiveMessage {
Subscribe(
query: ast.Query,
attributes: List(String),
subscriber: process.Subject(query_types.ReactiveDelta),
initial_state: query_types.QueryResult,
)
Unsubscribe(
subscriber: process.Subject(query_types.ReactiveDelta),
)
Notify(
changed_attributes: List(String),
current_state: state.DbState,
)
}
Constructors
-
Subscribe( query: ast.Query, attributes: List(String), subscriber: process.Subject(query_types.ReactiveDelta), initial_state: query_types.QueryResult, ) -
Unsubscribe( subscriber: process.Subject(query_types.ReactiveDelta), ) -
Notify( changed_attributes: List(String), current_state: state.DbState, )
Values
pub fn start_link() -> Result(
process.Subject(state.ReactiveMessage),
actor.StartError,
)