We have REST WebService. It makes request to other server, process result and returns it to user. Is there any benefit to开发者_开发知识库 make request to server2 asynchronous?
Decision of making service calls asynchronous depends upon the need. If the client can do something while the server is processing its request and reply back, the asynchronous service methods are great. At least I have used lot of such service methods. But if the client really need to wait, there is no point for making the call asynchronous.
Making the request asynchronous would allow for better scalability of the service. Asynchronous calls do not block threads, thus the thread can be used elsewhere while your service waits for a response. IIS only has so many threads to work with, so blocking them to wait for a request to come back is typically not a good idea.
精彩评论