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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for controlling the lifecycle of the scheduler worker. The worker will block until this context is cancelled. |
| triggerRepo | interfaces.TriggerRepo | The repository used to retrieve and manage trigger definitions. |
| cfg | config.TriggerSchedulerConfig | Configuration settings for the trigger scheduler, including execution QPS, burst, and resync interval. |
| baseURL | string | The base URL used for executing triggers. |
| clientOpts | ...connect.ClientOption | Optional client options for the trigger executor, such as interceptors or timeouts. |
Returns
| Type | Description |
|---|---|
func(ctx context.Context) error | A worker function that blocks until the provided context is cancelled, handling trigger scheduling and execution. |