Skip to main content

LoopEventSink

Trait LoopEventSink 

Source
pub trait LoopEventSink: Send + Sync {
    // Required methods
    fn record_cadence_fired<'life0, 'life1, 'async_trait>(
        &'life0 self,
        loop_id: &'life1 WorkflowId,
        window_seq: u64,
    ) -> Pin<Box<dyn Future<Output = Result<RecordOutcome, WorkloopError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_invariant_unconfirmed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        loop_id: &'life1 WorkflowId,
        alarm: InvariantAlarm,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkloopError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Durable append seam for engine-raised workloop events. Both paths MUST go through the target loop’s single Recorder (the one-writer law).

Required Methods§

Source

fn record_cadence_fired<'life0, 'life1, 'async_trait>( &'life0 self, loop_id: &'life1 WorkflowId, window_seq: u64, ) -> Pin<Box<dyn Future<Output = Result<RecordOutcome, WorkloopError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record CadenceFired { window_seq } in the loop’s history.

Returns RecordOutcome::RefusedTerminal when the loop’s active run already holds a terminal — a dead loop has no windows, and the refusal is the engine’s positive evidence of death.

§Errors

Returns WorkloopError when the append fails outright.

Source

fn record_invariant_unconfirmed<'life0, 'life1, 'async_trait>( &'life0 self, loop_id: &'life1 WorkflowId, alarm: InvariantAlarm, ) -> Pin<Box<dyn Future<Output = Result<(), WorkloopError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record InvariantUnconfirmed (the one alarm path) in the loop’s history. UNLIKE cadence fires, this append is honoured even after the run’s terminal: the alarm that reports a loop’s death must not be silenced by the very death it reports (R5.3’s premise). The event is status-invisible, so the terminal projection is untouched.

§Errors

Returns WorkloopError when the append fails outright.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§