1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
Files
go-mixed/concurrent/readme.md
2023-11-03 15:48:33 +08:00

21 lines
470 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

延迟队列
包含以下实现模型
1. 内存模式。
2. Redis模式
3. MQ模式
内存模式,在队列中放入。定时检查过期时间,过期时间到达时取出并使用协程执行。
Redis模式使用ZSET存储任务队列。定时取出规则内的任务。取出后使用ZREM删除并放入执行队列LPUSH。放入成功后在任务执行通道发送消息执行通道使用LPOP取出并执行。
```
queue := delayqueue.New()
```