Documentation
¶
Overview ¶
Package subflow adapts Dagu child workflow execution to the runtime executor's child workflow interface.
Index ¶
- type Local
- func (r *Local) Cancel(ctx context.Context, req executor.SubWorkflowCancelRequest) error
- func (r *Local) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
- func (r *Local) Run(ctx context.Context, req executor.SubWorkflowRequest) (*exec.RunStatus, error)
- func (r *Local) ShouldRun(_ context.Context, req executor.SubWorkflowRequest) bool
- type LocalOption
- func WithLocalArtifactFinalizer(finalizer runtime.ArtifactFinalizer) LocalOption
- func WithLocalDAGRunDirs(logDir, artifactDir string) LocalOption
- func WithLocalDAGRunStore(store exec.DAGRunStore) LocalOption
- func WithLocalLogWriterFactory(factory exec.LogWriterFactory) LocalOption
- func WithLocalProfileStore(store profilepkg.Store) LocalOption
- func WithLocalQueueStore(store exec.QueueStore) LocalOption
- func WithLocalRunStateStore(store runstate.Store) LocalOption
- func WithLocalSecretStore(store secretpkg.Store) LocalOption
- func WithLocalServiceRegistry(registry exec.ServiceRegistry) LocalOption
- func WithLocalStateStore(store dagstate.Store) LocalOption
- func WithLocalStatusPusher(pusher runtime.StatusPusher) LocalOption
- func WithLocalSubWorkflowRunnerFactory(factory rtagent.SubWorkflowRunnerFactory) LocalOption
- func WithLocalToolInstaller(installer dagutools.Installer) LocalOption
- func WithLocalWorkerID(workerID string) LocalOption
- type Option
- type Router
- func (r *Router) Cancel(ctx context.Context, req executor.SubWorkflowCancelRequest) error
- func (r *Router) Cleanup(ctx context.Context) error
- func (r *Router) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
- func (r *Router) Run(ctx context.Context, req executor.SubWorkflowRequest) (*exec.RunStatus, error)
- func (r *Router) ShouldRun(ctx context.Context, req executor.SubWorkflowRequest) bool
- type Runner
- func (r *Runner) Cancel(ctx context.Context, req executor.SubWorkflowCancelRequest) error
- func (r *Runner) Cleanup(ctx context.Context) error
- func (r *Runner) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
- func (r *Runner) Run(ctx context.Context, req executor.SubWorkflowRequest) (*exec.RunStatus, error)
- func (r *Runner) ShouldRun(_ context.Context, req executor.SubWorkflowRequest) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local runs child workflows in the current process through the runtime agent.
func (*Local) Retry ¶
func (r *Local) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
Retry retries a child workflow step in the current process.
type LocalOption ¶
type LocalOption func(*Local)
LocalOption configures Local.
func WithLocalArtifactFinalizer ¶
func WithLocalArtifactFinalizer(finalizer runtime.ArtifactFinalizer) LocalOption
WithLocalArtifactFinalizer sets the artifact finalizer used by child workflow agents.
func WithLocalDAGRunDirs ¶
func WithLocalDAGRunDirs(logDir, artifactDir string) LocalOption
WithLocalDAGRunDirs sets the log and artifact directories used by child workflow agents.
func WithLocalDAGRunStore ¶
func WithLocalDAGRunStore(store exec.DAGRunStore) LocalOption
WithLocalDAGRunStore sets the dag-run store used by child workflow agents.
func WithLocalLogWriterFactory ¶
func WithLocalLogWriterFactory(factory exec.LogWriterFactory) LocalOption
WithLocalLogWriterFactory sets the log writer factory used by child workflow agents.
func WithLocalProfileStore ¶
func WithLocalProfileStore(store profilepkg.Store) LocalOption
WithLocalProfileStore sets the runtime profile store used by child workflow agents.
func WithLocalQueueStore ¶
func WithLocalQueueStore(store exec.QueueStore) LocalOption
WithLocalQueueStore sets the queue store used by child workflow agents.
func WithLocalRunStateStore ¶
func WithLocalRunStateStore(store runstate.Store) LocalOption
WithLocalRunStateStore sets the run-state store used by child workflow agents.
func WithLocalSecretStore ¶
func WithLocalSecretStore(store secretpkg.Store) LocalOption
WithLocalSecretStore sets the secret store used by child workflow agents.
func WithLocalServiceRegistry ¶
func WithLocalServiceRegistry(registry exec.ServiceRegistry) LocalOption
WithLocalServiceRegistry sets the service registry used by child workflow agents.
func WithLocalStateStore ¶
func WithLocalStateStore(store dagstate.Store) LocalOption
WithLocalStateStore sets the state store used by child workflow agents.
func WithLocalStatusPusher ¶
func WithLocalStatusPusher(pusher runtime.StatusPusher) LocalOption
WithLocalStatusPusher sets the status pusher used by child workflow agents.
func WithLocalSubWorkflowRunnerFactory ¶
func WithLocalSubWorkflowRunnerFactory(factory rtagent.SubWorkflowRunnerFactory) LocalOption
WithLocalSubWorkflowRunnerFactory sets the nested child workflow runner factory.
func WithLocalToolInstaller ¶
func WithLocalToolInstaller(installer dagutools.Installer) LocalOption
WithLocalToolInstaller sets the installer used to make child DAG tools available.
func WithLocalWorkerID ¶
func WithLocalWorkerID(workerID string) LocalOption
WithLocalWorkerID sets the worker ID reported by child workflow agents.
type Option ¶
type Option func(*Runner)
Option configures Runner.
func WithCancellationTimeout ¶
WithCancellationTimeout sets how long cancellation waits for a terminal status.
func WithLogInterval ¶
WithLogInterval sets the waiting progress log interval.
func WithPollInterval ¶
WithPollInterval sets the status polling interval.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router selects the first child workflow runner that accepts a request.
func NewRouter ¶
func NewRouter(runners ...executor.SubWorkflowRunner) *Router
NewRouter creates a child workflow runner that tries runners in order.
func (*Router) Cancel ¶
Cancel routes cancellation to the runner that owns req.RunID. Unknown ownership falls back to best-effort cancellation across all runners.
func (*Router) Retry ¶
func (r *Router) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
Retry retries req with the first matching runner.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes child workflows through Dagu's distributed coordinator.
func New ¶
func New(dispatcher exec.Dispatcher, defaultMode config.ExecutionMode, opts ...Option) *Runner
New creates a coordinator-backed child workflow runner.
func (*Runner) Retry ¶
func (r *Runner) Retry(ctx context.Context, req executor.SubWorkflowRetryRequest) (*exec.RunStatus, error)
Retry schedules a parent-managed retry for a child workflow step.