搜索结果
查询Tags标签: TaskRunner,共有 3条记录-
js 实现红黄绿循环打印
// 红黄绿: 使用异步编程方案, promise, async await// 循环打印: 一轮打印完了以后递归重复这一过程const taskRunner = (light, timeout) => {return new Promise((resolve) => {setTimeout(() => resolve(console.log(light)), timeout);})}const task = a…
2022/6/19 23:23:34 人评论 次浏览 -
SpringBoot 设置服务一启动就执行、初始化数据
定义一个类实现ApplicationRunner接口,然后Override这个ApplicationRunner接口的run方法@Component public class TaskRunner implements ApplicationRunner {public static final Logger log = LoggerFactory.getLogger(TaskRunner.class);@Overridepublic void run(App…
2021/7/10 23:36:21 人评论 次浏览 -
SpringBoot 设置服务一启动就执行、初始化数据
定义一个类实现ApplicationRunner接口,然后Override这个ApplicationRunner接口的run方法@Component public class TaskRunner implements ApplicationRunner {public static final Logger log = LoggerFactory.getLogger(TaskRunner.class);@Overridepublic void run(App…
2021/7/10 23:36:21 人评论 次浏览