pub struct EventRegistry { /* private fields */ }Expand description
Registry that dispatches events to all registered sinks.
emit hands an event to each sink one after another, in
the order the sinks were registered, and every sink has the event before
emit returns, so each sink receives every event in the
order it was emitted. A sink that refuses an event does not stop the sinks
after it: its refusal is returned with its name. A sink that is slow holds
up the sinks after it, so a sink that sends events over a network hands
them to a queue of its own and returns.
Implementations§
Source§impl EventRegistry
impl EventRegistry
Sourcepub async fn emit(&self, event: &RazeriEvent) -> Vec<(String, EventSinkError)>
pub async fn emit(&self, event: &RazeriEvent) -> Vec<(String, EventSinkError)>
Record an event, then hand it to every sink, one after another in the order they were registered.
Returns each sink’s refusal with the sink’s name; a refusal does not stop the sinks after it.
Sourcepub fn record(&self, event: RazeriEvent)
pub fn record(&self, event: RazeriEvent)
Record an event without dispatching it to sinks.
Sourcepub fn events(&self) -> Vec<RazeriEvent>
pub fn events(&self) -> Vec<RazeriEvent>
Return all recorded events in chronological order.
Sourcepub fn recent_events(&self, limit: usize) -> Vec<RazeriEvent>
pub fn recent_events(&self, limit: usize) -> Vec<RazeriEvent>
Return the most recent events in chronological order.
Sourcepub fn events_for_workflow(&self, workflow_id: &str) -> Vec<RazeriEvent>
pub fn events_for_workflow(&self, workflow_id: &str) -> Vec<RazeriEvent>
Return events associated with the provided workflow identifier.
Sourcepub fn recent_summaries(&self, limit: usize) -> Vec<EventSummary>
pub fn recent_summaries(&self, limit: usize) -> Vec<EventSummary>
Return human-readable summaries for the most recent events.
Sourcepub async fn flush_all(&self) -> Vec<(String, EventSinkError)>
pub async fn flush_all(&self) -> Vec<(String, EventSinkError)>
Flush all sinks.
Sourcepub fn sink_names(&self) -> Vec<String>
pub fn sink_names(&self) -> Vec<String>
The names of the sinks this registry dispatches to, in the order they were registered.
Sourcepub fn query(&self, q: &EventQuery) -> Vec<RazeriEvent>
pub fn query(&self, q: &EventQuery) -> Vec<RazeriEvent>
Execute a flexible query against the recorded event history.