doc[zfoo]: update document

This commit is contained in:
godotg committed 2022-12-02 20:39:13 +08:00
1 parent 2f75896907
commit 44004d5f93
14 files changed
+965 -265

No files matched your search

+30 -31
View File
@@ -1,41 +1,40 @@
### Ⅰ. 简介
English | [简体中文](./README_CN.md)
- [scheduler](https://github.com/zfoo-project/zfoo/blob/main/scheduler/README.md) 时间任务调度总线,cron表达式的解析使用了spring自带的解释器模式
### Ⅰ. Introduction
### Ⅱ. 时间任务调度
- [scheduler](https://github.com/zfoo-project/zfoo/blob/main/scheduler/README.md) The time task scheduling bus, cron
expression parsing uses Spring's own interpreter pattern
### Ⅱ. Time task scheduling
![Image text](../doc/image/scheduler/scheduler01.png)
- 前后调整本地机器时间都会触发任务调度,本地开发非常有用
- ScheduledExecutorService每秒钟执行一次triggerPerSecond()方法,循环遍历可执行的scheduler
- zfoo认为一个程序中不会有太多的时间任务调度,所以ScheduledExecutorService只有一条线程,所以使用者要避免做耗时和阻塞的运算,如果有这样的需求可以抛到其它线程池
- zfoo scheduler使用Javassist字节码增强技术动态代理时间调度任务,避免了反射,没有性能损耗
- Adjusting the local machine time before and after triggers task scheduling, and local development is very useful
- ScheduledExecutorService.triggerPerSecond() executed every second,loop through the executable scheduler
- zfoo believes that a program does not have much time to schedule, so the Scheduled Executor Service has only one
thread, so users should avoid doing time-consuming and blocking operations
- zfoo scheduler uses Javassist bytecode enhancement technology to dynamically proxy time scheduling tasks, avoiding
reflections and no performance loss
### Ⅲ. Cron Expression Example
```
30 * * * * ? 每半分钟触发任务
30 10 * * * ? 每小时的10分30秒触发任务
30 10 1 * * ? 每天1点10分30秒触发任务
30 10 1 20 * ? 每月20号1点10分30秒触发任务
30 10 1 20 10 ? * 每年10月20号1点10分30秒触发任务
30 10 1 20 10 ? 2018 2018年10月20号1点10分30秒触发任务
30 10 1 ? 10 * 2018 2018年10月每天20号1点10分30秒触发任务
30 10 1 ? 10 SUN 2018 2018年10月每周日1点10分30秒触发任务
15,30,45 * * * * ? 每分钟的15,30,45秒个触发一次
15-45 * * * * ? 每分钟的15秒到45秒内,每秒都触发一次
15/5 * * * * ? 每分钟的15秒开始触发,每隔5秒触发一次
15-30/5 * * * * ? 每分钟的15秒到30秒之间开始触发,每隔5秒触发一次
0 0/3 * * * ? 每小时的第0分0秒开始,没三分钟触发一次
0 15 10 ? * MON-FRI 星期一到星期五每天10点15分0秒触发一次
0 15 10 L * ? 每个月的最后一天的10点15分0秒触发任务
0 15 10 LW * ? 每个月最后一个工作日的10点15分0秒触发任务
0 15 10 ? * 5L 每个月最后一个星期四的10点15分0秒触发任务
0 15 10 ? * 5#3 每个月第三周的星期四的10点15分0秒触发任务
说明:
*(星号):代表任何时刻都接受癿意思
,(逗号):代表分隔时段的意思
-(减号):代表一段时间范围内
/n(斜线):每隔n单位间隔
30 * * * * ? Task is triggered every half minute
30 10 * * * ? Trigger tasks every hour at 10 minutes and 30 seconds
30 10 1 * * ? Task is triggered every day at 1:10:30 seconds
30 10 1 20 * ? Task is triggered at 1:10:30 on the 20th of each month
30 10 1 20 10 ? * Task is triggered every year on October 20 at 1:10:30 seconds
30 10 1 20 10 ? 2018 Task is triggered on October 20, 2018 at 1:10:30 a.m
30 10 1 ? 10 * 2018 Task is triggered every day on the 20th at 1:10:30 seconds In October 2018
30 10 1 ? 10 SUN 2018 Task is triggered every Sunday in October 2018 at 1:10:30 seconds
15,30,45 * * * * ? Task is triggered every 15, 30, 45 seconds per minute
15-45 * * * * ? Task is triggered every second from 15 seconds to 45 seconds per minute
15/5 * * * * ? Triggers start at 15 seconds per minute and trigger every 5 seconds
15-30/5 * * * * ? Triggers start between 15 and 30 seconds per minute and trigger every 5 seconds
0 0/3 * * * ? It starts at 0:0 every hour and triggers every three minutes
0 15 10 ? * MON-FRI Triggered once a day from Monday to Friday at 10:15:00 seconds
0 15 10 L * ? Task is triggered at 10:15:00 on the last day of each month
0 15 10 LW * ? Task is triggered at 10:15:00 on the last working day of each month
0 15 10 ? * 5L Task is triggered at 10:15:00 on the last Thursday of every month
0 15 10 ? * 5#3 Task is triggered on the Thursday of the third week of every month at 10:15:00
```
+37
View File
@@ -0,0 +1,37 @@
简体中文 | [English](./README.md)
### Ⅰ. 简介
- [scheduler](https://github.com/zfoo-project/zfoo/blob/main/scheduler/README.md) 时间任务调度总线,cron表达式的解析使用了spring自带的解释器模式
### Ⅱ. 时间任务调度
![Image text](../doc/image/scheduler/scheduler01.png)
- 前后调整本地机器时间都会触发任务调度,本地开发非常有用
- ScheduledExecutorService每秒钟执行一次triggerPerSecond()方法,循环遍历可执行的scheduler
- zfoo认为一个程序中不会有太多的时间任务调度,所以ScheduledExecutorService只有一条线程,所以使用者要避免做耗时和阻塞的运算,如果有这样的需求可以抛到其它线程池
- zfoo scheduler使用Javassist字节码增强技术动态代理时间调度任务,避免了反射,没有性能损耗
### Ⅲ. Cron Expression Example
```
30 * * * * ? 每半分钟触发任务
30 10 * * * ? 每小时的10分30秒触发任务
30 10 1 * * ? 每天1点10分30秒触发任务
30 10 1 20 * ? 每月20号1点10分30秒触发任务
30 10 1 20 10 ? * 每年10月20号1点10分30秒触发任务
30 10 1 20 10 ? 2018 2018年10月20号1点10分30秒触发任务
30 10 1 ? 10 * 2018 2018年10月每天20号1点10分30秒触发任务
30 10 1 ? 10 SUN 2018 2018年10月每周日1点10分30秒触发任务
15,30,45 * * * * ? 每分钟的15,30,45秒个触发一次
15-45 * * * * ? 每分钟的15秒到45秒内,每秒都触发一次
15/5 * * * * ? 每分钟的15秒开始触发,每隔5秒触发一次
15-30/5 * * * * ? 每分钟的15秒到30秒之间开始触发,每隔5秒触发一次
0 0/3 * * * ? 每小时的第0分0秒开始,没三分钟触发一次
0 15 10 ? * MON-FRI 星期一到星期五每天10点15分0秒触发一次
0 15 10 L * ? 每个月的最后一天的10点15分0秒触发任务
0 15 10 LW * ? 每个月最后一个工作日的10点15分0秒触发任务
0 15 10 ? * 5L 每个月最后一个星期四的10点15分0秒触发任务
0 15 10 ? * 5#3 每个月第三周的星期四的10点15分0秒触发任务
```