TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BabySid/aether/llms.txt
Use this file to discover all available pages before exploring further.
broker.TaskBroker interface is the single bridge between the Aether engine (scheduler) and workers (executors). It manages the full lifecycle of task distribution: dispatch from the engine side, and fetch/start/complete from the worker side. Implementations decide the transport — goroutines, a message queue, Redis, gRPC, or any other mechanism.
Implementations must be safe for concurrent use by multiple goroutines. The engine calls
Dispatch and Cancel from scheduling goroutines, and workers call FetchTask, StartTask, and CompleteTask concurrently.TaskBroker interface
Engine-side methods
Dispatch(ctx, assignment)
Dispatch(ctx, assignment)
Submits a task for execution. The implementation decides how and where the task runs.
- Local broker: starts a goroutine that calls the executor directly
- Distributed broker: enqueues to a message queue or HTTP endpoint
The fat task assignment carrying all information the worker needs.
Cancel(ctx, taskRunID)
Cancel(ctx, taskRunID)
Sends a cancellation signal to a running or queued task. The implementation decides how to propagate the signal — context cancellation, a remote API call, or a queue message.
Cancel is best-effort. The engine always updates the store regardless of whether Cancel succeeds.The task run ID to cancel.
Worker-side methods
FetchTask(ctx, workerID)
FetchTask(ctx, workerID)
Pulls a pending task for execution. This is typically a blocking or long-poll call.Returns
(nil, context.DeadlineExceeded) or (nil, context.Canceled) when the context expires before a task is available.Identifies the calling worker for affinity or logging purposes.
StartTask(ctx, taskRunID, workerID)
StartTask(ctx, taskRunID, workerID)
Reports that a worker has begun executing a task. Must be called before any actual computation starts. The implementation delivers this event to the engine — either by directly invoking the
StartHandler (local) or publishing to a queue (distributed).The engine transitions the task and its ancestor containers from Ready to Running when this is received.CompleteTask(ctx, result)
CompleteTask(ctx, result)
Reports the final execution result after the task finishes. The implementation delivers this to the engine — either directly via
CompletionHandler or through a queue.The task result including outputs and exit code.
TaskAssignment
The “fat assignment” struct carries everything a worker needs to execute a task. Workers never need to call back into the store.Unique ID of this task run. Pass to
StartTask and embed in TaskResult.The executor type identifier. The worker uses this to route to the correct
executor.Plugin.Fully resolved task inputs including parameters and secrets. Nil if the task declares no inputs.
Number of retries already consumed.
0 = first attempt. Passed through to ExecuteRequest.RetryCount.TaskResult
The message a worker sends to the engine when a task finishes.Phase and Metrics are deliberately absent — the engine derives Phase from ExecOutputs.Code and records Metrics itself in OnTaskStarted / OnTaskCompleted.
Callback types
These types are convenience helpers for local (in-process) broker implementations. They are not part of theTaskBroker interface contract.
StartTask and CompleteTask.