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 SelectionLimit 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, historical metrics, config) is injected at construction by the integrator.
type Factory ¶
type Factory interface {
// For returns the SelectionLimit for the given queue.
For(cfg Config) (SelectionLimit, error)
}
Factory builds the SelectionLimit for a queue. Implementations are provided by integrators (and tests) and inject whatever signals they need at construction.
type SelectionLimit ¶
type SelectionLimit interface {
// Limit returns the current maximum number of paths a batch may build in
// parallel. The selector caps its Promote decisions at this. It takes no
// parameters; anything an implementation needs is injected at construction.
Limit(ctx context.Context) (int, error)
}
SelectionLimit is the "how much" policy that bounds how many paths a batch may build in parallel.
It is the selector's companion: the selector decides *which* of a batch's paths are worth building (its ranking); the selection limit decides *how many* of them may run at once. Separating the two keeps selector logic free of resource accounting and lets the bound scale with build resources without touching that logic.
The value is dynamic: it may change between calls, so the selector reads it each pass rather than caching it.
Unlike the dependency limit, this limit is injected into the seam that uses it — the selector is constructed with it and calls it itself — never passed as a method parameter, keeping the selector interface limit-free and stable.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fake provides a programmable selectionlimit.SelectionLimit for tests and examples.
|
Package fake provides a programmable selectionlimit.SelectionLimit for tests and examples. |
|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |