If an application is blocking until a query returns a response, doesn’t it make sense to execute queries on a thread pool?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Only if you expect to perform work during that period, otherwise there’s no sense doing it. A nice way to do it is to have your API return a
Future. Something like:Of course, you should typically submit your
CallablesorRunnablesto anExecutorService.