pub struct Link { /* private fields */ }Expand description
A processor’s view of “downstream” / “upstream” — a sender to each neighbour,
wired by crate::pipeline::Pipeline. Cloned into the processor’s run loop.
Implementations§
Source§impl Link
impl Link
Sourcepub async fn push(&self, meta: FrameMeta, frame: Frame, direction: Direction)
pub async fn push(&self, meta: FrameMeta, frame: Frame, direction: Direction)
Push a frame to the adjacent processor in direction. Mirrors pipecat
push_frame (frame_processor.py:688): fires the observer on_push hook,
then enqueues onto the neighbour’s input channel. Backpressure: awaits if
the neighbour’s bounded (normal) channel is full (PROCESSOR-DESIGN §2.2).
Sourcepub async fn push_down(&self, frame: Frame)
pub async fn push_down(&self, frame: Frame)
Convenience: push a fresh frame downstream with new meta.
Sourcepub async fn push_up(&self, frame: Frame)
pub async fn push_up(&self, frame: Frame)
Convenience: push a fresh frame upstream with new meta.
Sourcepub async fn push_error(&self, message: impl Into<String>, fatal: bool)
pub async fn push_error(&self, message: impl Into<String>, fatal: bool)
Push an Frame::Error upstream (pipecat push_error, :630).
Sourcepub async fn broadcast(&self, frame: Frame)
pub async fn broadcast(&self, frame: Frame)
Broadcast a frame both directions with paired sibling ids (pipecat
broadcast_frame, :731) — used for Frame::Interruption.
Sourcepub fn start_ttfb(&self)
pub fn start_ttfb(&self)
Mark the start of a TTFB measurement (no-op when metrics disabled).
Sourcepub async fn stop_ttfb(&self, model: Option<String>)
pub async fn stop_ttfb(&self, model: Option<String>)
Emit a MetricsData::Ttfb downstream for the elapsed time since
Link::start_ttfb. No-op when metrics are disabled or no start was set.
Sourcepub fn start_processing(&self)
pub fn start_processing(&self)
Mark the start of a processing-time measurement.
Sourcepub async fn stop_processing(&self, model: Option<String>)
pub async fn stop_processing(&self, model: Option<String>)
Emit a MetricsData::Processing downstream for the elapsed time.
Sourcepub async fn report_llm_usage(
&self,
model: Option<String>,
tokens: LlmTokenUsage,
)
pub async fn report_llm_usage( &self, model: Option<String>, tokens: LlmTokenUsage, )
Emit an MetricsData::LlmUsage downstream (gated on usage metrics).
Sourcepub async fn report_tts_usage(&self, characters: u64)
pub async fn report_tts_usage(&self, characters: u64)
Emit a MetricsData::TtsUsage downstream (gated on usage metrics).