Node.js and COMET

January 31, 2010

Today I started to study node.js, for these last days there was a lot of interesting posts about it.

So to begin understanding it, I setup to port two COMET based examples I did back when I started using twisted to do it.

Note that this may contain javascript misconceptions, as I’m not experienced with it and my js idiom is more geared towards python than proper js.

The first example is a basic comet server which prints a string to each connected user

simple comet

The other example sends the result of twitter searchs to all connected users:

twitter and comet

Node.JS presents a different toolset to solve the current problems we have. It used the excellent libev, among V8 and other cool stuff, and JS is a very modern and flexible language (at least more than I thought about it when trying to do web stuff).

Cheers

Advertisements