Skip to content

Add resource gates to control queue eligibility by resource availability#203

Merged
robacarp merged 1 commit into
masterfrom
claude/resource-aware-executor-scaling-2DTvG
Mar 16, 2026
Merged

Add resource gates to control queue eligibility by resource availability#203
robacarp merged 1 commit into
masterfrom
claude/resource-aware-executor-scaling-2DTvG

Conversation

@robacarp

@robacarp robacarp commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

Introduces a resource-aware gating system that allows queues to be excluded from dequeuing when external resources (GPU, CPU, network, etc.) are constrained. This enables the job scheduler to respect system resource pressure and avoid overloading specific resources.

fixes #169

@robacarp robacarp force-pushed the claude/resource-aware-executor-scaling-2DTvG branch from a4d623c to c697ab9 Compare March 16, 2026 05:15
Introduces ResourceGate, an abstract base class that controls whether
queues should be dequeued based on external resource availability (GPU
utilization, CPU load, network bandwidth, etc.). The base class handles
TTL-based caching of check results; subclasses implement #check.

Built-in gates:
- OpenGate: always allows (default)
- ThresholdGate: samples a metric via callback, blocks when >= threshold

Gates are configured per-queue on QueueList via resource_gates hash.
The QueueList#queues method filters out gated queues on every access,
so dequeue adapters always see current resource state. Multiple queues
can share a gate instance to represent a shared resource boundary.

https://claude.ai/code/session_01PG9VitHQLVVWAJmMtFvQcA
@robacarp robacarp force-pushed the claude/resource-aware-executor-scaling-2DTvG branch from c697ab9 to 94640df Compare March 16, 2026 05:17
@robacarp robacarp merged commit 6a96cc1 into master Mar 16, 2026
3 checks passed
@robacarp robacarp deleted the claude/resource-aware-executor-scaling-2DTvG branch March 16, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Investigate capacities and needs

2 participants