Skip to main content

run_processor

Function run_processor 

Source
pub async fn run_processor(
    p: Box<dyn FrameProcessor>,
    rx: ProcessorRx,
    link: Link,
    setup: ProcessorSetup,
)
Expand description

The framework-owned per-processor loop. Runs until the input channels close or a terminal frame (End/Cancel) is forwarded.

PROCESSOR-DESIGN §2.2 pseudocode, made real:

  • biased select drains the system channel first (priority);
  • Start runs start() then forwards;
  • Interruption drains the normal queue of interruptible frames (keeping uninterruptible ones — End/Stop/FunctionCallResult/UpdateSettings) then forwards;
  • End/Stop/Cancel run stop(), forward, and (End/Cancel) break;
  • any other frame goes to process_frame; an Err becomes an upstream Error{fatal:false}.