-
Notifications
You must be signed in to change notification settings - Fork 821
Closed
Labels
Description
我在Handler中使用了CompletableFuture,代码如下:
public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception {
SomeTask task = new SomeTask(completableFuture);
ThreadPoolUtil.getInstance().execute(task);
completableFuture.whenComplete((res, ex) -> {
try {
afterCheckRights(res, asyncResp, invocation);
} catch (Throwable e) {
asyncResp.consumerFail(new InvocationException(Status.BAD_GATEWAY, e.getMessage()));
}
});
}
private void afterCheckRights(String res, AsyncResponse asyncResp, Invocation invocation) throws Exception {
// 发现这里切换了线程,之前是eventloop的,现在是自己定义的线程池,这样有什么影响吗?
}Reactions are currently unavailable