02 2022 档案
摘要:异步 在需要异步的方法上加上@Async 比如业务代码 @Service public class AsyncService { @Async public void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e
阅读全文
摘要:定时任务 TaskExecutor 任务执行者 TaskScheduler 任务调度者 @EnableScheduling //开启定时功能的注解 @Scheduled 什么时候执行 Cron表达式 测试用例 @Service public class ScheduledService { /* 3
阅读全文