Little eagle - SpringBoot实战管理系统(五)redis
项目源码自取↓:
异步、邮件与定时任务:
https://github.com/codersliu/springtest
springboot整合redis:
https://github.com/codersliu/springboot10-redisTest
异步任务
在开发环境中,对于不能实时返回用户数据的处理过程,应当在处理前通知用户,并在计算完成后返回计算结果。即通过异步任务,在数据开始处理时通知用户当前信息正在处理,处理完毕后返回结果。
通过一个example理解什么是异步任务
新建AsynService用于暂停程序执行,模拟在异步任务中,数据处理过程中的计算
1 | package com.sliu.springtest.service; |