Expand description
Spawn coordination contract for broker-managed backends.
This module does not launch child processes yet. It owns the state that Phase 4/5 launch code needs before spawning: per-backend-key budget windows, single-flight protection, retry-after hints for refused Hello replies, and process-wide file locks for backend spawn ownership.
Structs§
- Spawn
Budget Config - Spawn-budget tuning.
- Spawn
Budget Snapshot - Current budget state for metrics/admin snapshots.
- Spawn
Coordinator - Coordinates bounded spawn attempts for backend keys.
- Spawn
Lock File Identity - Stable identity for an opened lock file on platforms that expose it.
- Spawn
Lock Guard - RAII guard for an acquired backend spawn lock.
- Spawn
Permit - Token returned for a spawn attempt that may proceed.
Enums§
- Spawn
Begin Error - Errors returned when a spawn attempt cannot begin.
- Spawn
Lock Error - Errors returned while acquiring a backend spawn lock.
- Spawn
Outcome - Result of a spawn attempt.
Constants§
- DEFAULT_
SPAWN_ ATTEMPTS_ PER_ WINDOW - Default backend spawn attempts allowed per budget window.
- DEFAULT_
SPAWN_ BUDGET_ WINDOW - Default backend spawn budget window.
Functions§
- acquire_
spawn_ lock - Acquire the backend spawn lock at
path.