Documentation
¶
Overview ¶
Package worker runs the consumer side of dispatch: a loop that leases tasks from a queue, executes them on a node, and reports results. The control plane runs workers as goroutines for local scaling; `dispatch work` runs the same loop in its own process, which is what Kubernetes deployments and serverless containers replicate to scale out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Worker ¶
type Worker struct {
// Deployment names the deployment, for metric labels.
Deployment string
// Queue supplies tasks; competing workers share it.
Queue queue.Queue
// Results receives each task's outcome.
Results queue.Results
// Node executes the tasks.
Node node.Node
// Recorder receives task metrics. Nil disables recording.
Recorder metrics.Recorder
// Backoff is the pause after a transient dequeue failure (e.g. the
// control plane briefly unreachable). Zero means one second.
Backoff time.Duration
}
Worker consumes tasks for one deployment on one node.
Click to show internal directories.
Click to hide internal directories.