Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SlotConfig ¶
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, workerId uuid.UUID, opts ...DAGOperatorOpt) (*DAGOperator, error)
NewDAGOperator constructs a DAG operator and starts a goroutine that polls the database for the tenant's DAG workflows, registering each as a worker action so matching tasks are routed to it. The action set is data-driven (not static config), so it is refreshed on a ticker the same way the HTTP operator refreshes actions from its healthcheck.
func (*DAGOperator) Cleanup ¶
func (d *DAGOperator) Cleanup()
Cleanup stops the workflow poller in addition to the shared operator's teardown.
func (*DAGOperator) Drain ¶
func (d *DAGOperator) Drain()
Drain stops the workflow poller and drains in-flight tasks without pausing the worker (used for bulk teardown, where the caller pauses all operator workers in one query).
func (*DAGOperator) HandleAction ¶
func (d *DAGOperator) HandleAction(ctx context.Context, action *contracts.AssignedAction) error
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.