Expand description
The FrameProcessor trait + the channel-runtime building blocks
(PROCESSOR-DESIGN §2).
Each processor runs in its own tokio task fed by a bounded mpsc channel
(Data/Control) plus an unbounded mpsc channel (System frames jump the queue).
The framework owns the task loop (runtime::run_processor); an impl only
writes FrameProcessor::process_frame (and optional start/stop hooks).
Re-exports§
pub use runtime::run_processor;pub use runtime::ProcessorRx;pub use runtime::ProcessorTx;
Modules§
- frame
- The pipeline
Frametaxonomy (PROCESSOR-DESIGN §1). - metrics
- Metrics carried on
Frame::Metrics. - runtime
- The framework-owned per-processor task loop (PROCESSOR-DESIGN §2.2/§2.3/§2.5).
Structs§
- Clock
- A monotonic nanosecond clock shared across a task’s processors. Mirrors
pipecat’s pipeline
Clock(task.py): oneInstantbase captured at setup,now_ns()returns elapsed-since-base in ns. - Envelope
- The frame envelope that travels a processor’s input channel
(PROCESSOR-DESIGN §2.1). Carries the
FrameMetaout of band so the hotFramevariant stays a thin pointer move. - Link
- A processor’s view of “downstream” / “upstream” — a sender to each neighbour,
wired by
crate::pipeline::Pipeline. Cloned into the processor’s run loop. - Processor
Setup - One-time per-task wiring handed to every processor at startup (mirrors pipecat
FrameProcessorSetup,frame_processor.py:71): the pipeline clock, the (optional) observer fan-out, the shared cancellation token, and the metric toggles.
Enums§
- Stop
Reason - Why a processor’s
FrameProcessor::stopwas called. - Topology
- The wiring shape a processor expands to when a
crate::pipeline::Pipelinelinks its members (PROCESSOR-DESIGN §3). A leaf is one spawned task; aChainis wired head→tail in order; aParallelfans one input into every branch and funnels/dedups the outputs. This is howPipeline/ParallelPipelinenest without a downcast.
Traits§
- Frame
Processor - The building block (PROCESSOR-DESIGN §2.1). Each processor runs in its own
tokio task fed by a bounded mpsc channel; the framework owns the task loop, an
impl writes only
process_frame(and optionalstart/stop).
Functions§
- into_
topology - Convert a boxed processor into a wiring
Topology: a composite explodes into its internal graph; a leaf becomesTopology::Leaf. The single entry point the pipeline linker uses (object-safe, noSizedcoercion in a default body).