dagoperator

package
v0.109.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SlotConfig

func SlotConfig(op *sqlcv1.V1Operator, defaultSlots int) (map[string]int32, error)

Types

type DAGOperator

type DAGOperator struct {
	*operator.SharedOperator[DAGOperatorConfig]
	// contains filtered or unexported fields
}

func NewDAGOperator

func NewDAGOperator(op *sqlcv1.V1Operator, l *zerolog.Logger, repo repository.Repository, taskEventWriter operator.TaskEventWriter, opts ...DAGOperatorOpt) (*DAGOperator, error)

NewDAGOperator constructs a DAG operator. It is engine-internal: it needs the repository for the tenant's workflows and the engine-internal writer for triggering steps, so it is hosted in process only, by the claimer through the in-process host. Nothing runs until Start.

func (*DAGOperator) Drain

func (d *DAGOperator) Drain(ctx context.Context)

Drain implements operator.Operator: it stops the workflow poller, interrupts the runs in flight (they leave their tasks for reassignment) and waits for them, bounded by ctx. The host has paused the worker by then, so nothing new arrives.

func (*DAGOperator) HandleAction

func (d *DAGOperator) HandleAction(ctx context.Context, action *contracts.AssignedAction) error

func (*DAGOperator) Start added in v0.109.0

func (d *DAGOperator) Start(ctx context.Context, s operator.Session) error

Start implements operator.Operator: it keeps the session, registers the tenant's DAG workflows as the worker's actions before returning so the worker is assignable at once, and starts the goroutine that keeps them in sync. The action set is data-driven, so it is refreshed on a ticker.

type DAGOperatorConfig

type DAGOperatorConfig struct {
	// Slots is the number of concurrent task slots the operator's worker advertises. Defaults
	// to the server's configured default (WithSlots) when unset.
	Slots int `json:"slots"`
}

DAGOperatorConfig is the stored config for a DAG operator. Unlike the HTTP operator, the action set is not configured statically: the operator polls the database for the tenant's DAG workflows and registers each as an action (see pollWorkflows).

type DAGOperatorOpt added in v0.104.1

type DAGOperatorOpt func(*DAGOperator)

func WithSlots added in v0.104.1

func WithSlots(defaultSlots int) DAGOperatorOpt

WithSlots sets the server-wide default slot count (SERVER_DAG_OPERATOR_DEFAULT_SLOTS) used when the operator's stored config doesn't set its own Slots.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL