On Sun, May 18, 2008 at 09:34:22PM +0000, jdk head wrote:
> Thanks, Emil, for the quick response
> When resin's comet suspends the thread, does it not count against the
> <thread-max> setting?  If not, that's great.

Yes, that's right.  It may be better to think of it in this way, though:
the Comet servlet uses the threads from the same thread pool as
everything else.  When it suspends, the threads go back into the pool.
When it resumes, it takes a thread from the pool.  No additional threads
are being allocated for Comet either dynamically or statically.

> We're pretty deeply committed to GWT right now - lots of implementation
> already, so I need to figure out a good way to get GWT to work with resin
> comet.  I can think of two possibilities to try:

I think GWT is a great choice.  I hope I didn't imply that I don't think
it's suitable.  It would be great if it had better Comet support, but
AFAIK, it's not there yet.

> 1) make inital calls to GWT's RemoteServiceServlet, and pass its
> getThreadLocalRequest() and getThreadLocalResponse() into the comet servlet
> service() and resume().  Then hope the suspension and everything still works 
> ok

I'd have to check on this, but I don't think it would work.  That is, I
don't think you can pass a thread from a normal servlet to a Comet
servlet.  Also, I'm not sure what the semantics would be on the client
even if you could.

> 2) make initial calls to a resin comet servlet, then dig into the GWT source
> and figure out what classes are doing the serialization of the RPC objects. 
> Have the comet servlet use these directly.

This is more on track, but the problem still remains that you have to
decode an RPC request on the client.  This actually isn't that hard, but
it requires hacking the GWT compiler a bit.  All you really need to do
is create a stable name for methods on the JavaScript side, since GWT
will mangle them in its standard and obscure modes.  Then you can just
send down JavaScript invocations of those methods.

> Could you see either approach working? and if so, which would you recommend?

There has been some work on GWT and Comet. I've just glanced at these,
so I can't give detailed comments.

This one is a bit dated, but it might still work:

This one uses Jetty, so I'm not sure if it would work with Resin.



Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 456-0300

Caucho: Reliable Open Source
--> Resin: application server
--> Quercus: PHP in Java
--> Hessian Web Services

resin-interest mailing list

Reply via email to