Expand description
The framework-owned per-processor task loop (PROCESSOR-DESIGN §2.2/§2.3/§2.5).
Two channels per processor so System frames jump ahead of Data/Control
(pipecat does this with a PriorityQueue, frame_processor.py:119; a second
channel is the cheaper, branch-free Rust equivalent):
- bounded normal channel (Data/Control) → natural backpressure for media;
- unbounded system channel (Start/Cancel/Interruption/Error/…) → an interruption can never block on a full queue.
The loop biases the system channel, runs the processor’s lifecycle hooks on
lifecycle frames, drains interruptible frames on Frame::Interruption, and
converts a process_frame Err into an upstream Frame::Error.
Structs§
- Processor
Rx - The receive half held by a processor task: a bounded normal channel and an unbounded system channel.
- Processor
Tx - The send half: routes a frame by
Frame::class(System → the unbounded system channel, Data/Control → the bounded normal channel). Cheaply cloned into each neighbour’sLink.
Constants§
- NORMAL_
CHAN_ CAP - Default capacity of the bounded normal (Data/Control) channel — the
bench-rsvalue (~1.3 s of audio headroom @ 50 fps). PROCESSOR-DESIGN §2.2.
Functions§
- channel
- Build a processor channel pair (the bounded normal + unbounded system halves)
tagged with the owning processor’s
name. - run_
processor - The framework-owned per-processor loop. Runs until the input channels close or
a terminal frame (
End/Cancel) is forwarded.
Type Aliases§
- Envelope
Sender Link’s sender alias for a neighbour (PROCESSOR-DESIGN §2.2).