Skip to main content

NewGoCronJob

Constructs a GoCronJob.

def NewGoCronJob(
ctx: context.Context,
t: *models.Trigger,
executor: Executor
) - > *GoCronJob

Constructs a GoCronJob object. This function is used to create a new cron job instance, associating it with a specific trigger and an executor.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the cron job, used for cancellation and carrying request-scoped values.
t*models.TriggerThe trigger definition for the cron job, specifying when and how often the job should run.
executorExecutorThe executor responsible for running the cron job's tasks when triggered.

Returns

TypeDescription
*GoCronJobA new instance of GoCronJob configured with the provided context, trigger, and executor.