mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 05:17:30 +08:00
Change NewBackground API to take *redis.Client
This commit is contained in:
21
asynq.go
21
asynq.go
@@ -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,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user