Django: JSON Notifications using Redis PubSub, Node.js & Socket.io Django: JSON Notifications using Redis PubSub, Node.js & Socket.io node.js node.js

Django: JSON Notifications using Redis PubSub, Node.js & Socket.io


I'd definitely not use node.js for this. You can handle websockets in Python just fine, with Celery or gevent or whatever.

Just create a thread which registers to Redis and listens for new messages.

When the user connects, put the socket into a weak-value hash indexed by the user's name; when a message for them arrives, look up the destination username in that hash and send it off. Weak-value because it cleans up after itself when the user disconnects. Simple, really.

I'd also send new messages to the server using the websocket instead of HTTP-PUT.


Sounds like you should use something like RabbitMQ http://www.rabbitmq.com/devtools.html there's a node.js implementation and more.

Check it out, it should cheer you up :)