This commit is contained in:
kevin
2020-07-29 18:12:19 +08:00
parent aa3ef20011
commit 6ac5a80f9a
11 changed files with 28 additions and 30 deletions

19
rq/internal/conf.go Normal file
View File

@@ -0,0 +1,19 @@
package internal
import (
"zero/core/queue"
"zero/core/stores/redis"
)
type RedisKeyConf struct {
redis.RedisConf
Key string `json:",optional"`
}
func (rkc RedisKeyConf) NewProducer(opts ...ProducerOption) (queue.Producer, error) {
return newProducer(rkc.NewRedis(), rkc.Key, opts...)
}
func (rkc RedisKeyConf) NewPusher(opts ...PusherOption) queue.QueuePusher {
return NewPusher(rkc.NewRedis(), rkc.Key, opts...)
}