java异步执行:
java
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Autowired
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
public String getStr(){
/**
主业务
*/
//异步推送
threadPoolTaskExecutor.submit(new Runnable() {
@Override
public void run() {
//异步执行业务
}
});
return "xxxxxx";
}