Skip to main content

ExecutionObserver

Trait ExecutionObserver 

Source
pub trait ExecutionObserver: Send + Sync {
    // Provided methods
    fn on_started(&self, _spec: &ExecutionSpec) { ... }
    fn on_paused(&self, _queries: &[LlmQuery]) { ... }
    fn on_partial_feed(&self, _query_id: &QueryId, _remaining: usize) { ... }
    fn on_resumed(&self) { ... }
    fn on_completed(&self, _result: &Value) { ... }
    fn on_failed(&self, _error: &str) { ... }
    fn on_cancelled(&self) { ... }
}
Expand description

Observer for execution state transitions.

Hooks cross-cutting concerns (stats, logging) without polluting the Execution core.

Provided Methods§

Source

fn on_started(&self, _spec: &ExecutionSpec)

Source

fn on_paused(&self, _queries: &[LlmQuery])

LLM request issued (transition to Paused).

Source

fn on_partial_feed(&self, _query_id: &QueryId, _remaining: usize)

Partial response arrived (not yet complete).

Source

fn on_resumed(&self)

All responses arrived, Lua resuming (transition to Running).

Source

fn on_completed(&self, _result: &Value)

Source

fn on_failed(&self, _error: &str)

Source

fn on_cancelled(&self)

Host-initiated cancellation.

Implementors§