Skip to main content

Module dispatch

Module dispatch 

Expand description

Unified SOP event dispatch helpers.

Structs§

SopCronCache
Pre-parsed cron schedules for SOP triggers. Built once at daemon startup to avoid re-parsing cron expressions on every scheduler tick.

Enums§

DispatchResult
Outcome of attempting to dispatch an event to the SOP engine.

Functions§

check_sop_cron_triggers
Check all cached cron SOP triggers for firings in the window (last_check, now] and dispatch events for each. Uses window-based evaluation so ticks between polls are never missed.
dispatch_peripheral_signal
Convenience wrapper for peripheral hardware callbacks. Builds a SopEvent with source Peripheral and topic "{board}/{signal}" then dispatches it through the standard path.
dispatch_sop_event
dispatch_sop_event_to
Dispatch an incoming event to one named SOP, after normal trigger matching. This is useful for channel routers that already selected a configured SOP name, while still requiring that SOP to declare a matching trigger.
dispatch_untrusted_fan_in
Headless fan-in chokepoint for untrusted external events (channel messages, AMQP deliveries, …): caps oversized topic/payload at the configured untrusted_payload_max_bytes (with an explicit truncation marker), stamps the event, dispatches it against loaded SOP triggers, and audits the results. Callers should gate on SopEngine::wants_source first to skip the work when no SOP listens.
process_headless_results
results_need_redelivery
True when at least one matched SOP is backpressured and no SOP has already started from this delivery. A durable transport (e.g. AMQP with durable_ack) can safely nack/requeue only when redelivery cannot replay a started SOP’s side effects.