You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/doc/periodicalexecutor.md

16 lines
388 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# PeriodicalExecutor设计
## 添加任务
* 当前没有未执行的任务
* 添加并启动定时器
* 已有未执行的任务
* 添加并检查是否到达最大缓存数
* 如到,执行所有缓存任务
* 未到,只添加
## 定时器到期
* 清除并执行所有缓存任务
* 再等待N个定时周期如果等待过程中一直没有新任务则退出