The global turn gate (SPEC ยง7D backpressure gate 3) โ a counting semaphore wrapped around the LLM HTTP call ONLY, never a whole Run (holding it across a Run deadlocks a parent against its children).
The gate MONITORS each acquirer: a Run process killed mid-call (interrupt, forced close, crash) releases its slot automatically โ the release never depends on the acquirer's own cleanup path running.
Summary
Functions
Block until a slot is granted to the calling process.
Returns a specification to start this module under a supervisor.
High-water mark of concurrently held slots (conformance probe).
Release the calling process's slot.
Functions
@spec acquire(pid()) :: :ok
Block until a slot is granted to the calling process.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec max_observed(pid()) :: non_neg_integer()
High-water mark of concurrently held slots (conformance probe).
@spec release(pid()) :: :ok
Release the calling process's slot.