Skip to main content

Module flow_projector

Module flow_projector 

Source
Expand description

Flow summary projector scanner.

Scans flow partitions ({fp:N}). For each flow: delegates the per-flow sample + summary-hash write to EngineBackend::project_flow_summary. The engine-side scanner body is thin by design — enumeration of flows is Valkey-specific (SSCAN on an index SET), but the projection itself lives behind the trait.

Interval: 15s (catchup mode — event-driven in production).

Cluster-safe: uses SSCAN on a partition-level index SET instead of SCAN.

§Two sources of public_flow_state

This scanner writes a DERIVED public_flow_state field to the flow summary projection. It does NOT touch flow_core.public_flow_state — that field is owned exclusively by ff_create_flow and ff_cancel_flow and is the authoritative state used for mutation guards (e.g. ff_add_execution_to_flow rejects adds when flow_core.public_flow_state is terminal).

Consumer guidance:

  • Mutation-guard / authoritative state → read flow_core.public_flow_state.
  • Dashboards / projected rollups → read the summary projection.

Reference: RFC-007 §Flow Summary Projection, RFC-010 §6.7

Structs§

FlowProjector