Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (52 sloc) 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.

You can’t perform that action at this time.