2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-08-01 13:44:37 +08:00

Add Queues field to Config

This commit is contained in:
Ken Hibino
2020-01-06 07:15:59 -08:00
parent ca78b92078
commit 03cb6eef09
3 changed files with 33 additions and 4 deletions

View File

@@ -19,6 +19,8 @@ type processor struct {
handler Handler
queueConfig map[string]uint
retryDelayFunc retryDelayFunc
// timeout for blocking dequeue operation.
@@ -44,9 +46,10 @@ type processor struct {
type retryDelayFunc func(n int, err error, task *Task) time.Duration
func newProcessor(r *rdb.RDB, n int, fn retryDelayFunc) *processor {
func newProcessor(r *rdb.RDB, n int, qcfg map[string]uint, fn retryDelayFunc) *processor {
return &processor{
rdb: r,
queueConfig: qcfg,
retryDelayFunc: fn,
dequeueTimeout: 2 * time.Second,
sema: make(chan struct{}, n),