symfonic.kernel.backpressure¶
backpressure ¶
Run-scoped bounded hand-off for event adapters (BP-1…BP-13).
Rendezvous adapters need no storage and are implemented by direct await or
async iteration in :mod:symfonic.kernel.adapters. This module is the sole
queue implementation for adapters whose compiled G9 row opts into decoupling.
AdapterMetrics
dataclass
¶
AdapterMetrics(high_watermark: int = 0, byte_high_watermark: int = 0, events_shed: dict[str, int] = dict(), blocked_seconds: float = 0.0, terminal_delivery_failed: bool = False, abandoned: bool = False)
Observable pressure for one adapter on one run (BP-12).
BoundedEventBuffer ¶
A per-run queue bounded by both event count and approximate bytes.
One slot is held back from non-terminal events under reserve. Under
preempt, a terminal event evicts only the oldest non-terminal entries.
No module-global registry or storage is involved (BP-8/BP-13).
Source code in src/symfonic/kernel/backpressure.py
close
async
¶
Detach this run's consumer and release all buffered references.
Source code in src/symfonic/kernel/backpressure.py
get
async
¶
Take the oldest surviving event, preserving emission order.
Source code in src/symfonic/kernel/backpressure.py
put
async
¶
Put an event, returning False only for a declared shed.