Skip to main content

ChannelInterceptor

Struct ChannelInterceptor 

Source
pub struct ChannelInterceptor { /* private fields */ }
Expand description

A BspInterceptor that forwards every event onto a tokio::sync::broadcast channel — every GUI / CLI / TUI then just subscribes.

Send failures (no active receivers, or a lagging receiver) are ignored by design: telemetry must never backpressure the scheduler.

Implementations§

Source§

impl ChannelInterceptor

Source

pub fn new(capacity: usize) -> Self

Creates an interceptor and its broadcast channel with the given capacity.

Source

pub fn subscribe(&self) -> Receiver<BspEvent>

Subscribes to the event stream.

Trait Implementations§

Source§

impl BspInterceptor for ChannelInterceptor

Available on crate feature tokio only.
Source§

fn on_superstep_start(&self, step: u64, frontier: &[NodeId])

A superstep is about to execute the given frontier.
Source§

fn on_node_start(&self, node_id: NodeId, name: &str)

A node began executing.
Source§

fn on_node_complete(&self, node_id: NodeId, name: &str, duration: Duration)

A node finished executing (including skip-bypassed executions, which report a zero duration).
Source§

fn on_node_error(&self, node_id: NodeId, name: &str, err: &BspError)

A node’s failure is propagating (after any retries were exhausted or classified fatal). Also fires when the failure is routed to an error edge.
Source§

fn on_node_retry( &self, node_id: NodeId, attempt: u32, wait: Duration, err: &BspError, )

A node failure was classified transient; the engine will re-execute after wait. attempt is the 1-based retry number.
Source§

fn on_edge_taken(&self, source: NodeId, target: NodeId, condition_label: &str)

An edge fired: its condition matched and a token was emitted toward target. This is what makes a GUI alive — highlight the active edge.
Source§

fn on_loop_iteration(&self, edge: EdgeId, iteration: u64, max: Option<u64>)

A budgeted edge fired against its iteration cap — badge the loop counter.
Source§

fn on_suspended(&self, suspensions: &[PendingSuspension])

One or more nodes requested suspension; the run is pausing.
Source§

fn on_complete(&self, steps: u64)

The run completed naturally after steps supersteps.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more