Skip to content

👯‍♀️ Spring Boot 使用线程池实现将业务逻辑提交到线程池中异步执行

hacker-and-painter/spring-boot-threadpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot 线程池的使用和扩展

原文地址 http://blog.csdn.net/boling_cavalry/article/details/79120268

运行效果

部分代码

@Service
public class AsyncServiceImpl implements AsyncService {

    private static final Logger logger = LoggerFactory.getLogger(AsyncServiceImpl.class);

    @Override
    @Async("asyncServiceExecutor")
    public void executeAsync() {
        logger.info("start executeAsync");
        try{
            Thread.sleep(1000);
        }catch(Exception e){
            e.printStackTrace();
        }
        logger.info("end executeAsync");
    }
}

About

👯‍♀️ Spring Boot 使用线程池实现将业务逻辑提交到线程池中异步执行

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages