Skip to main content

Module spawn_coordinator

Module spawn_coordinator 

Source
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§

SpawnBudgetConfig
Spawn-budget tuning.
SpawnBudgetSnapshot
Current budget state for metrics/admin snapshots.
SpawnCoordinator
Coordinates bounded spawn attempts for backend keys.
SpawnLockFileIdentity
Stable identity for an opened lock file on platforms that expose it.
SpawnLockGuard
RAII guard for an acquired backend spawn lock.
SpawnPermit
Token returned for a spawn attempt that may proceed.

Enums§

SpawnBeginError
Errors returned when a spawn attempt cannot begin.
SpawnLockError
Errors returned while acquiring a backend spawn lock.
SpawnOutcome
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.