Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller handles polling for tasks from the coordinator
func NewPoller ¶
func NewPoller(workerID string, coordinatorCli coordinator.Client, handler TaskHandler, index int, labels map[string]string) *Poller
NewPoller creates a new poller instance
type RemoteTaskHandlerConfig ¶
type RemoteTaskHandlerConfig struct {
// WorkerID is the identifier of this worker
WorkerID string
// CoordinatorClient is the coordinator client with load balancing support
CoordinatorClient coordinator.Client
// DAGStore is the store for DAG definitions
DAGStore exec.DAGStore
// DAGRunMgr is the manager for DAG runs
DAGRunMgr runtime.Manager
// StateStore is the persistent state store shared across DAG runs.
StateStore dagstate.Store
// ServiceRegistry is the service registry
ServiceRegistry exec.ServiceRegistry
// PeerConfig is the peer configuration
PeerConfig config.Peer
// Config is the main application configuration
Config *config.Config
// SecretStore resolves Dagu-managed secrets during execution.
SecretStore secret.Store
// ProfileStore resolves profile values during execution.
ProfileStore profile.Store
}
RemoteTaskHandlerConfig contains configuration for the remote task handler
type TaskHandler ¶
type TaskHandler interface {
Handle(ctx context.Context, task *coordinatorv1.Task) error
}
TaskHandler defines the interface for executing tasks.
func NewRemoteTaskHandler ¶
func NewRemoteTaskHandler(cfg RemoteTaskHandlerConfig) TaskHandler
NewRemoteTaskHandler creates a new TaskHandler that runs tasks in-process with status pushing and log streaming to the coordinator.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker represents a worker instance that polls for tasks from the coordinator.
func NewWorker ¶
func NewWorker( workerID string, maxActiveRuns int, coordinatorClient coordinator.Client, labels map[string]string, cfg *config.Config, ) *Worker
NewWorker creates a new worker instance.
func (*Worker) SetAfterTaskAckHook ¶
SetAfterTaskAckHook installs a hook that runs after a task claim has been acknowledged but before the worker registers or executes the task. Returning true abandons execution for that claimed task. This is intended for tests.
func (*Worker) SetHandler ¶
func (w *Worker) SetHandler(executor TaskHandler)
SetHandler sets a custom task executor for testing or custom execution logic