SpringBoot第45讲:SpringBoot定时任务 - Timer实现方式
定时任务在实际开发中有着广泛的用途,本文是SpringBoot第45讲,主要帮助你构建定时任务的知识体系,同时展示Timer 的schedule和scheduleAtFixedRate例子;后续的文章中我们将逐一介绍其它常见的定时任务,并与SpringBoot的集成。
文章目录
- SpringBoot第45讲:SpringBoot定时任务 - Timer实现方式
- 1、知识准备
- 1.1、什么样的场景会使用定时任务?
- 1.2、定时任务有哪些实现方式?
- 2、Timer实现案例
- 2.1、schedule延迟任务
- 2.2、schedule周期任务
- 2.3、scheduleAtFixedRate
- 3、进一步理解
- 3.1、schedule 和 sch