We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,很高兴看到这个项目,非常受益。有点问题想跟您讨论下。
The text was updated successfully, but these errors were encountered:
您好,很高兴看到这个项目,非常受益。有点问题想跟您讨论下。 CompletionService是通过内部队列保存线程执行的结果,并保证了先执行完线程的结果会优先进入队列;然而,很难想到有啥实际的应用场景。第一,如果是为了拿每个线程的结果做二次处理,那么完全可以放在各个子线程中去处理;第二,如果是为了拿到所有线程的执行结果返回给上层服务,那么可以采用CompletableFuture.allOf来做。。。求大神指教。 ListenableFuture是添加了监听的功能,当执行完成或者抛出异常后,做处理。。。既然这样,为什么不是在子线程执行中直接做处理呢?感觉很奇怪。。求大神指教
这个CompletionService/ListenableFuture 我没有介绍好像,CompletionService/ListenableFuture 这两个我目前都没用过 ,可以关注我公众号加群讨论
Sorry, something went wrong.
ListenableFuture是Guava提供的监视Future是否完成任务,还在阻塞阶段,Java的CompletableFuture就提供了这个特点。
No branches or pull requests
您好,很高兴看到这个项目,非常受益。有点问题想跟您讨论下。
The text was updated successfully, but these errors were encountered: