1. 异常处理
whenComplete((result,ex)-> {
if(null != ex) {
// must do exception handle
}
}
whenCompleteAsync(
// some async call
fun1();
).exceptionally(ex-> {
// must do this if fun1 doesn't has error handling
});
1. 异常处理
whenComplete((result,ex)-> {
if(null != ex) {
// must do exception handle
}
}
whenCompleteAsync(
// some async call
fun1();
).exceptionally(ex-> {
// must do this if fun1 doesn't has error handling
});
本文标题:Future使用原则
本文链接:https://www.haomeiwen.com/subject/vpeslqtx.html
网友评论