MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Add

Method Add

pkg/redis/redis.go:659–664  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

657
658// Add adds a task s to the queue with a timestamp startAt.
659func (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.

Callers 1

TestTaskQueueFunction · 0.95

Implementers 2

mockTaskQueuepkg/telemetry/exporter/task_queue_test
RedisTaskQueuepkg/telemetry/exporter/task_queue.go

Calls 1

addTaskFunction · 0.85

Tested by 1

TestTaskQueueFunction · 0.76