Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal reports whether the given phase is in the terminal set. Tasks at a terminal phase must not be re-spawned; operator intervention is required.
func NewAgentsHandler ¶
NewAgentsHandler returns an http.Handler that lists all known agent configs from the in-memory store as JSON. If authSecret is non-empty, requests must include X-Agent-Auth header with the secret.
func NewHealthcheckTriggerHandler ¶
func NewHealthcheckTriggerHandler( runner probe.HealthcheckRunner, ) http.Handler
NewHealthcheckTriggerHandler returns an HTTP handler that fires the healthcheck runner once per invocation with fire-and-forget + single-flight semantics. Concurrent invocations collapse into one in-flight run (second request is silently dropped).
The handler uses context.Background() for its internal operations so it is not affected by the caller's context cancellation. The handler only stops when the HTTP server shuts down.
Types ¶
type TaskEventHandler ¶
type TaskEventHandler interface {
ConsumeMessage(ctx context.Context, msg *sarama.ConsumerMessage) error
// EvalDeferredRespawns evaluates all pending deferred-respawn entries immediately.
// Called by RunDeferredRespawnLoop on each tick; also callable directly in tests.
EvalDeferredRespawns(ctx context.Context) error
// RunDeferredRespawnLoop polls evalDeferredRespawns every deferredRespawnInterval
// until ctx is cancelled. Must be run alongside the Kafka consumer.
RunDeferredRespawnLoop(ctx context.Context) error
}
TaskEventHandler processes task event messages from Kafka and manages deferred respawns.
func NewTaskEventHandler ¶
func NewTaskEventHandler( jobSpawner spawner.JobSpawner, branch base.Branch, resolver pkg.ConfigResolver, resultPublisher pkg.ResultPublisher, taskStore *pkg.TaskStore, currentDateTime libtime.CurrentDateTimeGetter, ) TaskEventHandler
NewTaskEventHandler creates a new TaskEventHandler.