pub struct EventRegistry { /* private fields */ }Expand description
Registry that dispatches events to all registered sinks.
Errors from individual sinks are logged but do not halt the pipeline — this is the “fire and continue” pattern.
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)>
Dispatch an event to all sinks.
Errors from individual sinks are collected but do not propagate — all sinks are attempted regardless of failures.
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.
Trait Implementations§
Source§impl Default for EventRegistry
impl Default for EventRegistry
Source§impl EventEmitter for EventRegistry
impl EventEmitter for EventRegistry
Source§fn emit_event<'life0, 'async_trait>(
&'life0 self,
event: RazeriEvent,
) -> Pin<Box<dyn Future<Output = Vec<(String, EventSinkError)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn emit_event<'life0, 'async_trait>(
&'life0 self,
event: RazeriEvent,
) -> Pin<Box<dyn Future<Output = Vec<(String, EventSinkError)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Emit a canonical event into the monitoring pipeline.
Auto Trait Implementations§
impl !Freeze for EventRegistry
impl !RefUnwindSafe for EventRegistry
impl !UnwindSafe for EventRegistry
impl Send for EventRegistry
impl Sync for EventRegistry
impl Unpin for EventRegistry
impl UnsafeUnpin for EventRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more