tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Praveen Balaji" <>
Subject Tomcat - CometProcessor question
Date Wed, 25 Apr 2007 09:51:25 GMT
Hi all,
Not sure if the subject is appropriate. Here's a description of what I
need to achieve:

I have a servlet that can block on a request for a long duration. This
essentially means the Tomcat processor thread that is serving the HTTP
request is blocked and unable to process more incoming requests.

>From a broader sense, what I need to achieve is to get hold of the
client socket I/O streams and let the Tomcat processor thread free. I
want to process the request OUTSIDE the lifecycle of the service method.
This is so I can achieve better response time with less processor

I understand that the Servlet Specification no longer mandates that the
request be serviced in the service method. I also understand that
Tomcat6 leverages java's NIO support to provide these non-blocking
semantics to servlets that implement CometProcessor. However, my
observation is that this is particularly useful for AJAX (and similar)
client applications that use a keep alive connection to provide
responsive UI. My primary requirement is that:

1.	I have control of reading the request. I do not want to wait on
comet events to read the request payload.
2.	I should be able to respond at a later point of time. So I need
a handle to the socket output stream.

Is the NIO Connector and CometProcessor the right solution for my
problem? If yes, how do I achieve the above requirements? If not, does
Tomcat provide me any alternatives?

Any help will be greatly appreciated and willingly devoured.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message