异步方法@Async
使用例子
class testAsync{
@Async public Future<String> doTest() throws Exception { //TODO
return new AsyncResult<>("返回信息"); }
}
判断是否执行完成
t = new testAsync
Future<String> test = t.doTest();
test.isDone();
使用例子
class testAsync{
@Async public Future<String> doTest() throws Exception { //TODO
return new AsyncResult<>("返回信息"); }
}
判断是否执行完成
t = new testAsync
Future<String> test = t.doTest();
test.isDone();