Wednesday, May 17th, 2006
Dietrich Kappe has been wanting to do some COMET, using Apache and Jetty as the server side piece. His experience shows that it isn’t easy to do yet:
I had intended to marry the nice Apache2 event MPM and Jetty 6 with Continuations in order to achieve a thrifty, thread-sparing COMET capable Java app. The idea is that the Event MPM module in apache frees up a thread when an open connection to the browser is snoozing and Jetty frees up a thread when the backend servlet is snoozing. There are two problems, however.
- The Event MPM module seems to only snooze between requests. With COMET the need to snooze happens during a requests, i.e. we are expecting something to come back from the server.
- The request handler module — in this case mod_jk or mod_proxy_ajp — and not the Event MPM module handles the socket connections to the servlet container. From my reading of the most recent SVN branch, the modules are using blocking I/O and not polling.
It seems there’s still a bit of work to be done to make Apache and Jetty do the COMET dance.
There has been a lot of interest in COMET. Some people even prefer to see a world where the majority of Ajax apps are built using event-driven architectures including the network level. When will we have a simple way to do this on the server side? There are interesting vendors out there like Lightstreamer who are trying to feed into this market.
Posted by Dion Almaer at 1:37 am