Add adds a task s to the queue with a timestamp startAt.
(ctx context.Context, r redis.Cmdable, s string, startAt time.Time, replace bool)
| 657 | |
| 658 | // Add adds a task s to the queue with a timestamp startAt. |
| 659 | func (q *TaskQueue) Add(ctx context.Context, r redis.Cmdable, s string, startAt time.Time, replace bool) error { |
| 660 | if r == nil { |
| 661 | r = q.Redis |
| 662 | } |
| 663 | return addTask(ctx, r, q.Key, q.MaxLen, s, startAt, replace) |
| 664 | } |
| 665 | |
| 666 | // Dispatch dispatches the tasks of the queue. It will continue to run until the context is done. |
| 667 | // consumerID is used to identify the consumer and should be unique for all concurrent calls to Dispatch. |