RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Cockatoo, a simple chat server using EM and the Long Polling technique

We’ve just open sourced a simple chat server we wrote a few months ago, Cockatoo. It’s using the fantastic EventMachine (yep, we know that node.js is the new kid in town, but well…). Several “push” technique exists, but we focused on Long Polling as it’s very easy to setup, be it on the server or the client side. We’ve also made a little presentation on “Long Polling with EventMachine”.


Interesting stuff there.

It’s always great to see internal projects getting open-sourced, but I’m a bit confused here by not finding any tests, did you forget to commit them ?

Thanks for posting. I spent the weekend looking for a node.js alternative, since Heroku don’t support that yet. So after some research I ended up playing with EM, but I’m not sure if it is possible to run an EM-server on Herokus platform. Do you know if that is possible?

Anyhow, thanks for sharing the project.

@Jhchabran unit testing wa definitively not a priority because of several try & error because between the client and the server side. Besides, testing asynchronous stuff is not really easy. Of course we could have modularized a little bit the code so we could test the non async part. We’ll certainly do that in a further release. Along with more security ;-)

Is there an example of a live app using it?

@McRipper here <a href=’‘”></a> you will need to create an account

@yannski Thankyou!

Heroku has (experimentally) supported Node for a while now:

Is it compatible with rails3 ?


@Evi there’s no relationship with Rails or Sinatra. The daemon part is completely independant. You can use Cockatoo with any webapplication (in Django, Grails, etc). We provide several parts so you can easily build the client part. As we usually use Rails, we provide some haml templates, and a Javascript implementation of the client side protocol.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in