diff --git a/servlet-async/README.md b/servlet-async/README.md index cf45506058..257ff566cc 100644 --- a/servlet-async/README.md +++ b/servlet-async/README.md @@ -9,8 +9,16 @@ What is it? ----------- This is a sample project showing the use of asynchronous servlets. - -It shows how to detach the execution of a resource intensive task from the request processing thread, so the thread is free to serve other client requests. The resource intensive tasks are executed using a dedicated thread pool and create the client response asynchronously. + +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. System requirements ------------------- diff --git a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java index 14678d0f64..e369c2099a 100644 --- a/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java +++ b/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java @@ -29,33 +29,40 @@ *
* *- * The servlet is registered and mapped to /AsynchronousServlet using the {@link WebServlet} - * annotation. The {@link LongRunningService} is injected by CDI. + * The servlet is registered and mapped to /AsynchronousServlet using the {@link WebServlet} annotation. The + * {@link LongRunningService} is injected by CDI. *
* *- * It shows how to detach the execution of a resource intensive task from the - * request processing thread, so the thread is free to serve other client requests. - * The resource intensive tasks are executed using a dedicated thread pool and - * create the client response asynchronously using the {@link AsyncContext}. + * 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 using the {@link AsyncContext}. + *
+ * + *+ * 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. *
* * @author Christian Sadilek