Comet Chat with Rupy

by Dylan SchiemannJuly 8th, 2008

In my recent review of Comet projects hosted by Google code, I ran across Rupy, which recently added a Comet chat demo, also known as the Hello World of Comet.

Rupy takes an interesting approach with a very very tiny Java server implementation. Even if Java is not your server-side language of choice, it’s worth taking a look:

Weighing less than 50KB, rupy is probably the smallest Java NIO HTTP server in the world.

Rupy is inherently non-blocking asynchronous, which makes it the ideal candidate for high concurrency real-time applications pushing dynamic data.

Tested with acme, rupy performs on average ~1500 requests per second. To put that figure in perspective; acme doesn’t use keep-alive, so that means 1500 unique TCP connections serving dynamic content per second! Thanks to NIO and an event queue to avoid selector trashing, this figure degrades gracefully under high concurrency.

In the succinct words of Rupy project lead Marc Larue that help define what Comet is really all about:

As for a starting point I think that there is a bigger picture to the new-wave of web techniques that fueled rupy’s creation.

Comet and REST both have simplicity as the common energy source, after all HTTP is just TCP and web-services being over-engineered is an understatement.

Firebug Output for Rupy Chat App

2 Responses to “Comet Chat with Rupy”

  1. Phill Kenoyer Says:

    So now a socket connection is being renamed to Comet? I thought Comet was long request that waiting for data and then restarted?

    I’ve been doing sockets with Flash for a few years now. Sockets are the way to go for doing push to a web browser.

  2. DylanSchiemann Says:

    @Phill… I think this is exactly what Greg is trying to figure out in his definition of Comet post: http://cometdaily.com/2008/06/16/the-definition-of-comet/ . It has generally been used to describe techniques, transports, protocols, and servers that allow low latency data transit to the web.

    General complaints about Flash sockets are the requirement of a plug-in (some enterprises block Flash, or some users, like me, that loathe flash ads), and that the Flash to JavaScript bridge has some performance issues, which I think were actually fixed in Flash 9.

    That said, in my opinion, Comet is about finding the fastest way to get data between the client and the server.


Copyright 2015 Comet Daily, LLC. All Rights Reserved