定义延迟队列生产者接口以及基于redis的实现
This commit is contained in:
39
delay/redis_produce.go
Normal file
39
delay/redis_produce.go
Normal file
@@ -0,0 +1,39 @@
|
||||
// Package delay ...
|
||||
//
|
||||
// Description : delay ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2022-07-06 17:59
|
||||
package delay
|
||||
|
||||
import (
|
||||
"github.com/go-redis/redis/v8"
|
||||
)
|
||||
|
||||
// NewRedisQueue 获取redis队列实例
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 18:09 2022/7/6
|
||||
func NewRedisQueue(redisInstance *redis.Client) IProduce {
|
||||
return &redisProduce{client: redisInstance}
|
||||
}
|
||||
|
||||
// withRedis 使用redis实现延迟队列
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:59 2022/7/6
|
||||
type redisProduce struct {
|
||||
client *redis.Client
|
||||
}
|
||||
|
||||
// Produce 生产数据
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 18:03 2022/7/6
|
||||
func (rp *redisProduce) Produce(data *Queue) error {
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user