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
The other example sends the result of twitter searchs to all connected users:
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
April 19, 2011 at 3:43 am
Thank you for the code, kind sir!
In your first example: https://gist.github.com/291145
How can a second user listen to the event being sent? Forgive me, this is my very first venture into node.js!
April 20, 2011 at 12:15 pm
Thanks.
I’m not sure if I understood, but in any case you can replicate the createserver block just under the previous one. Each listen() method will open a different port !