pub struct DispatchEngine { /* private fields */ }Expand description
Dispatch engine: accepts FiredEvents from the supervisor and orchestrates
context capture, audit recording, and trigger invocation.
Typical P2 runtime usage:
loop {
let (fired, health) = supervisor.poll();
engine.process(fired);
}Implementations§
Source§impl DispatchEngine
impl DispatchEngine
pub fn new( context_window: usize, trigger_handler: Box<dyn TriggerHandler>, recorder: Box<dyn DispatchRecorder>, ) -> Self
Sourcepub fn process(&mut self, fired: Vec<FiredEvent>)
pub fn process(&mut self, fired: Vec<FiredEvent>)
Process a batch of FiredEvents from one supervisor poll cycle.
For each event:
- Snapshot the context ring and insert the event.
- Record a
Dispatchedaudit event (idempotency marker, before firing). - Invoke the trigger handler.
- On failure, record a
Failedaudit event with the structured cause.
Auto Trait Implementations§
impl !RefUnwindSafe for DispatchEngine
impl !UnwindSafe for DispatchEngine
impl Freeze for DispatchEngine
impl Send for DispatchEngine
impl Sync for DispatchEngine
impl Unpin for DispatchEngine
impl UnsafeUnpin for DispatchEngine
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