Files
go-zero/rq/internal/conf.go
2020-07-29 18:12:19 +08:00

20 lines
426 B
Go

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...)
}