pub struct EventProcessor { /* private fields */ }Expand description
Continuous event processor
Runs in the background, continuously consuming events and routing them to registered handlers.
Implementations§
Source§impl EventProcessor
impl EventProcessor
Sourcepub fn builder(db: Arc<AzothDb>) -> EventProcessorBuilder
pub fn builder(db: Arc<AzothDb>) -> EventProcessorBuilder
Create a new builder
Sourcepub async fn run(&mut self) -> Result<()>
pub async fn run(&mut self) -> Result<()>
Run the processor until shutdown is signaled
This is an async function that runs continuously, polling for new events and processing them through registered handlers.
Sourcepub fn run_blocking(&mut self) -> Result<()>
pub fn run_blocking(&mut self) -> Result<()>
Run the processor synchronously (blocking)
Useful for single-threaded applications or testing.
Sourcepub fn process_batch(&mut self) -> Result<usize>
pub fn process_batch(&mut self) -> Result<usize>
Process a single batch of events
Returns the number of events processed.
Sourcepub fn shutdown_handle(&self) -> ShutdownHandle
pub fn shutdown_handle(&self) -> ShutdownHandle
Get a handle for shutting down the processor
Auto Trait Implementations§
impl Freeze for EventProcessor
impl !RefUnwindSafe for EventProcessor
impl !Send for EventProcessor
impl !Sync for EventProcessor
impl Unpin for EventProcessor
impl !UnwindSafe for EventProcessor
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