MCPcopy Index your code
hub / github.com/beevik/timerqueue / Schedule

Method Schedule

queue.go:43–52  ·  view source on GitHub ↗

Schedule schedules a timer for exectuion at time tm. If the timer was already scheduled, it is rescheduled.

(t Timer, tm time.Time)

Source from the content-addressed store, hash-verified

41// Schedule schedules a timer for exectuion at time tm. If the
42// timer was already scheduled, it is rescheduled.
43func (q *Queue) Schedule(t Timer, tm time.Time) {
44 if data, ok := q.table[t]; !ok {
45 data = &timerData{t, tm, 0}
46 heap.Push(&q.heap, data)
47 q.table[t] = data
48 } else {
49 data.time = tm
50 heap.Fix(&q.heap, data.index)
51 }
52}
53
54// Unschedule unschedules a timer's execution.
55func (q *Queue) Unschedule(t Timer) {

Callers 2

populateQueueFunction · 0.80
ExampleQueueFunction · 0.80

Calls 1

PushMethod · 0.80

Tested by 2

populateQueueFunction · 0.64
ExampleQueueFunction · 0.64