Skip to main content

Start

Wires together the trigger scheduler and returns a worker function that blocks until ctx is cancelled. The caller should register it with sc.AddWorker("trigger-scheduler", ...).

def Start(
ctx: context.Context,
triggerRepo: interfaces.TriggerRepo,
cfg: config.TriggerSchedulerConfig,
baseURL: string,
clientOpts: ...connect.ClientOption
) - > func(ctx context.Context) error

Wires together the trigger scheduler and returns a worker function that blocks until ctx is cancelled. The caller should register it with sc.AddWorker("trigger-scheduler", ...).

Parameters

NameTypeDescription
ctxcontext.ContextThe context for controlling the lifecycle of the scheduler worker. The worker will block until this context is cancelled.
triggerRepointerfaces.TriggerRepoThe repository used to retrieve and manage trigger definitions.
cfgconfig.TriggerSchedulerConfigConfiguration settings for the trigger scheduler, including execution QPS, burst, and resync interval.
baseURLstringThe base URL used for executing triggers.
clientOpts...connect.ClientOptionOptional client options for the trigger executor, such as interceptors or timeouts.

Returns

TypeDescription
func(ctx context.Context) errorA worker function that blocks until the provided context is cancelled, handling trigger scheduling and execution.