Skip to content

Instantly share code, notes, and snippets.

@kain-jy
kain-jy / websocket_tornado_redis.py
Created May 28, 2012 00:43 — forked from pelletier/websocket_tornado_redis.py
adapt for newer redis and redis-py
"""
This is a simple example of WebSocket + Tornado + Redis Pub/Sub usage.
Do not forget to replace YOURSERVER by the correct value.
Keep in mind that you need the *very latest* version of your web browser.
You also need to add Jacob Kristhammar's websocket implementation to Tornado:
Grab it here:
http://gist.github.com/526746
Or clone my fork of Tornado with websocket included:
http://github.com/pelletier/tornado
Oh and the Pub/Sub protocol is only available in Redis 2.0.0: