MCPcopy Create free account
hub / github.com/codnect/chrono / CreateScheduledRunnableTask

Function CreateScheduledRunnableTask

task.go:108–124  ·  view source on GitHub ↗
(id int, task Task, triggerTime time.Time, period time.Duration, fixedRate bool)

Source from the content-addressed store, hash-verified

106}
107
108func CreateScheduledRunnableTask(id int, task Task, triggerTime time.Time, period time.Duration, fixedRate bool) (*ScheduledRunnableTask, error) {
109 if task == nil {
110 return nil, errors.New("task cannot be nil")
111 }
112
113 if period < 0 {
114 period = 0
115 }
116
117 return &ScheduledRunnableTask{
118 id: id,
119 task: task,
120 triggerTime: triggerTime,
121 period: period,
122 fixedRate: fixedRate,
123 }, nil
124}
125
126func (scheduledRunnableTask *ScheduledRunnableTask) Cancel() {
127 scheduledRunnableTask.taskMu.Lock()

Callers 4

ScheduleMethod · 0.85
ScheduleAtFixedRateMethod · 0.85

Calls

no outgoing calls

Tested by 1