conf.go 428 B

12345678910111213141516171819
  1. package redisqueue
  2. import (
  3. "zero/core/queue"
  4. "zero/core/stores/redis"
  5. )
  6. type RedisKeyConf struct {
  7. redis.RedisConf
  8. Key string `json:",optional"`
  9. }
  10. func (rkc RedisKeyConf) NewProducer(opts ...ProducerOption) (queue.Producer, error) {
  11. return newProducer(rkc.NewRedis(), rkc.Key, opts...)
  12. }
  13. func (rkc RedisKeyConf) NewPusher(opts ...PusherOption) queue.QueuePusher {
  14. return NewPusher(rkc.NewRedis(), rkc.Key, opts...)
  15. }