2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-04-21 16:20:18 +08:00

Export (High|Low)PriorityQueue constant from base pkg

This commit is contained in:
Ken Hibino 2020-01-01 12:12:49 -08:00
parent 2e95166f39
commit eb191c07d1
2 changed files with 13 additions and 11 deletions

View File

@ -9,14 +9,16 @@ import (
// Redis keys // Redis keys
const ( const (
processedPrefix = "asynq:processed:" // STRING - asynq:processed:<yyyy-mm-dd> processedPrefix = "asynq:processed:" // STRING - asynq:processed:<yyyy-mm-dd>
failurePrefix = "asynq:failure:" // STRING - asynq:failure:<yyyy-mm-dd> failurePrefix = "asynq:failure:" // STRING - asynq:failure:<yyyy-mm-dd>
queuePrefix = "asynq:queues:" // LIST - asynq:queues:<qname> queuePrefix = "asynq:queues:" // LIST - asynq:queues:<qname>
DefaultQueue = queuePrefix + "default" // LIST DefaultQueue = queuePrefix + "default" // LIST
ScheduledQueue = "asynq:scheduled" // ZSET HighPriorityQueue = queuePrefix + "high" // LIST
RetryQueue = "asynq:retry" // ZSET LowPriorityQueue = queuePrefix + "low" // LIST
DeadQueue = "asynq:dead" // ZSET ScheduledQueue = "asynq:scheduled" // ZSET
InProgressQueue = "asynq:in_progress" // LIST RetryQueue = "asynq:retry" // ZSET
DeadQueue = "asynq:dead" // ZSET
InProgressQueue = "asynq:in_progress" // LIST
) )
// Priority indicates importance of a task in comparison with others. // Priority indicates importance of a task in comparison with others.

View File

@ -10,9 +10,9 @@ func TestQueueKey(t *testing.T) {
p Priority p Priority
want string want string
}{ }{
{PriorityHigh, "asynq:queues:high"}, {PriorityHigh, HighPriorityQueue},
{PriorityDefault, "asynq:queues:default"}, {PriorityDefault, DefaultQueue},
{PriorityLow, "asynq:queues:low"}, {PriorityLow, LowPriorityQueue},
} }
for _, tc := range tests { for _, tc := range tests {