Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// QueueName identifies the queue this PrioritizationLimit serves.
QueueName string
}
Config carries the per-queue identity handed to a Factory. The system knows only the queue name; everything a policy needs to compute the limit (a capacity feed, cost budgets, config) is injected at construction by the integrator.
type Factory ¶
type Factory interface {
// For returns the PrioritizationLimit for the given queue.
For(cfg Config) (PrioritizationLimit, error)
}
Factory builds the PrioritizationLimit for a queue. Implementations are provided by integrators (and tests) and inject whatever signals they need at construction.
type PrioritizationLimit ¶
type PrioritizationLimit interface {
// Limit returns the current maximum number of concurrent builds for the
// queue. The prioritizer admits at most this many candidates. It takes no
// parameters; anything an implementation needs is injected at construction.
Limit(ctx context.Context) (int, error)
}
PrioritizationLimit is the "how much" policy that bounds how many builds a queue may run at once — the queue's concurrent-build budget.
It is the prioritizer's companion: the prioritizer decides *which* of the queue's pending builds run (its ranking across all in-flight batches); the prioritization limit decides *how many* fit at once. It is the queue-wide resource knob, the ultimate cap on speculation's demand on CI.
The value is dynamic: it may change between calls, so the prioritizer reads it each round rather than caching it.
It is injected into the prioritizer at construction and called by it, never passed as a method parameter, keeping the prioritizer interface limit-free and stable.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fake provides a programmable prioritizationlimit.PrioritizationLimit for tests and examples.
|
Package fake provides a programmable prioritizationlimit.PrioritizationLimit for tests and examples. |
|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
|
Package static provides a prioritizationlimit.PrioritizationLimit that always returns a fixed, construction-time value.
|
Package static provides a prioritizationlimit.PrioritizationLimit that always returns a fixed, construction-time value. |