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

Function NewRedisTaskQueue

pkg/telemetry/exporter/task_queue.go:78–95  ·  view source on GitHub ↗

NewRedisTaskQueue returns new telemetry task queue.

(
	ctx context.Context, cl *ttnredis.Client, maxLen int64, group string, streamBlockLimit time.Duration,
)

Source from the content-addressed store, hash-verified

76
77// NewRedisTaskQueue returns new telemetry task queue.
78func NewRedisTaskQueue(
79 ctx context.Context, cl *ttnredis.Client, maxLen int64, group string, streamBlockLimit time.Duration,
80) (TaskQueue, TaskQueueCloser, error) {
81 tq := &RedisTaskQueue{
82 queue: &ttnredis.TaskQueue{
83 Redis: cl,
84 MaxLen: maxLen,
85 Group: group,
86 Key: cl.Key(telemetryKey),
87 StreamBlockLimit: streamBlockLimit,
88 },
89 }
90 if err := tq.Init(ctx); err != nil {
91 return nil, nil, err
92 }
93
94 return tq, tq.Close, nil
95}
96
97// Init initializes the TelemetryTaskQueue.
98func (q *RedisTaskQueue) Init(ctx context.Context) error {

Callers 1

TestConcurrentTaskSetFunction · 0.85

Calls 2

InitMethod · 0.95
KeyMethod · 0.65

Tested by 1

TestConcurrentTaskSetFunction · 0.68