Search |
||
Grizzlet reloaded: Bringing Ajax Push/Comet to the Masses?Posted by jfarcand on February 14, 2008 at 6:02 PM PST
Last September I've introduced Grizzlet, which is a simple but powerful enough way to write Ajax Push aka Comet applications. I came with the Grizzlet concept mostly after having collaborated to multiples Comet applications build on top of the Grizzly Comet 'framework'. Although the Grizzly Comet framework can be simple to use, some of my collaborators wanted to have something more lightweight. Some of them were from the embedded devices space, where the size of the web server and the application is quite important. Even a database might want to have an embedded web server with comet inside. For those reasons, I've made the little monster small and easy to use. Well, I was under the impression it was easy, but it wasn't perfect. The first things users didn't liked is the fact that the GrizzletContainer wasn't supporting "traditional" web packaging bundle like a .jar or a .war, but instead needed an exploded folder "a la" JRuby. Message received: I've added support and now launching your Grizzlet is more simple. You just bundle your Comet application inside a war file like you usually do when using Servlet, and do: You still have to specify the Grizzlet's class name, but that's something that can easily be done when the GrizzletContainer is embedded, or used inside GlassFish v3 where more powerful deployment capability are available. The next issue users where having was with the Grizzlet Request/Response API, which were kind of incomplete (kudo to Zaid for his contributions)...not anymore :-) You can take a look at the GrizzletRequest and GrizzletResponse API. Those API are really close to the HttpServletRequest/Response object. Next I've added a couple of new examples (download them here and here). My favorite one is the JMaki based. This demo is quite interesting (see a picture here) as it stress the server quite hard. You enter word and move the word on the screen, and your word will move in all browser. Nice little game. It was already simple to implement it using Grizzly Comet, it is more simple with Grizzlet: In less than 100 lines, we have a nice game :-).
What's next? I think the Grizzlet concept can be easily extended and ported to Web Server like Tomcat and Jetty, by changing the AsynConnection interface to support generics: I would also think than REST can take advantage of that API...something for Paul! Now I was looking for a project's name and came a name related to Comet: AtmoSpherE :-). The project is not yet started, but once started, it will be a good sandbox to extends the Grizzlet concept and make it work with the upcoming Servlet 3.0 Comet proposal, which is still too complex in my opinion. Being able to resume/suspend a connection is a good step in the right direction, but I think not having any support/strategies when the push operation happens is something missing. Comet applications build on top of Servlet 3.0 will have to spawn threads to avoid blocking when doing the push operations, will have to throttle the push to avoid flodding clients, etc...but that's not the goal of this blog. I will soon start my adventure in CometDaily where I will talk about those issues. For now, The Grizzlet adventures are quite challenging, thanks to the community! technorati: grizzly jersey grizzlet jmaki comet ajax glassfish »
Related Topics >>
Java Enterprise Comments
Comments are listed in date ascending order (oldest first)
Submitted by dun4n on Fri, 2008-02-22 06:54.
You make me sick ! How many new things to try ? I'll never have the time to try all of your tricks in one life ...
Thanks for all what you do about Grizzly :)
Submitted by kboufelliga on Wed, 2008-05-28 17:32.
Pretty cool!
When will grizzlet be available for jetty ?
Thanks,
Submitted by pramod_ppp on Wed, 2008-10-01 22:51.
Hi Jean, I am new to Glassfish and Grizzly. I am evaluating server side solution for comet types of application. I did looked in to jetty and grizzly. could you please help me understand how does grizzly will be deployed in galssfish and provide performance same as the jetty http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/
Thanks
Submitted by vserg on Wed, 2008-09-17 11:18.
Hi JF,
Could you please update links to examples. The following links are broken:
http://download.java.net/maven/2/com/sun/grizzly/grizzlet-jmaki/1.7-SNAP... and http://download.java.net/maven/2/com/sun/grizzly/grizzlet-chat/1.7-SNAPS...
Regards
|
||
|