mozilla/treeherder-service — pull request #94 by maurodoglio (2013-12-20 17:12:26+00:00)
Title: add gevent-socketio machinery

This patch adds push notifications via websocket to the client. The basic component is a gevent server that listens for updates on rabbitmq and notifies those clients who subscribed for it. The subscription mechanism is based on a simple routing key with the following structure:

[ * | try | mozilla-inbound | ...]\( [ * | job | job_failure | resultset ] \)

The first member is the branch name (or a * wildcard) and the second optional member is the event type (again * is allowed)
So for example you can subscribe using the following keys:

\* (equivalent to \*.\*)
\*.job
try.\*
try.job_failure

You can start a gevent-socketio server with the following command:
python treeherder/events/run_socketio.py --broker-url=amqp://rabbituser:rabbitpass@localhost:5672/treeherder --host=0.0.0.0

For an example of a very basic socketio client see https://gist.github.com/maurodoglio/8058063