Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 3.21 KB

README.adoc

File metadata and controls

73 lines (52 loc) · 3.21 KB

servlet-async: How to Write an Asynchronous Servlet

The servlet-async quickstart demonstrates how to use asynchronous servlets to detach long-running tasks and free up the request processing thread.

What is it?

The servlet-async quickstart is a sample project showing the use of asynchronous servlets in {productNameFull}.

It shows how to detach the execution of a long-running task from the request processing thread, so the thread is free to serve other client requests. The long-running tasks are executed using a dedicated thread pool and create the client response asynchronously.

A long-running task in this context does not refer to a computation intensive task executed on the same machine but could for example be contacting a third-party service that has limited resources or only allows for a limited number of concurrent connections. Moving the calls to this service into a separate and smaller sized thread pool ensures that less threads will be busy interacting with the long-running service and that more requests can be served that do not depend on this service.