Change NewBackground API to take *redis.Client

This commit is contained in:
Ken Hibino
2019-12-29 14:50:46 -08:00
parent 62624cb0d8
commit fc71857c7c
4 changed files with 18 additions and 37 deletions

View File

@@ -1,13 +1,10 @@
package asynq
import "github.com/go-redis/redis/v7"
/*
TODOs:
- [P0] Pagination for `asynqmon ls` command
- [P0] Show elapsed time for InProgress tasks (asynqmon ls inprogress)
- [P0] Go docs + CONTRIBUTION.md + Github issue template + License comment
- [P0] Redis Sentinel support
- [P1] Add Support for multiple queues and priority
*/
@@ -19,21 +16,3 @@ type Task struct {
// Payload holds data needed to process the task.
Payload Payload
}
// RedisConfig specifies redis configurations.
// TODO(hibiken): Support more configuration.
type RedisConfig struct {
Addr string
Password string
// DB specifies which redis database to select.
DB int
}
func newRedisClient(cfg *RedisConfig) *redis.Client {
return redis.NewClient(&redis.Options{
Addr: cfg.Addr,
Password: cfg.Password,
DB: cfg.DB,
})
}