Is non-blocking Redis pubsub possible?

If you’re thinking of non-blocking, asynchronous processing, you’re probably using (or should use) asynchronous framework/server.

  • if you’re using Tornado, there is Tornado-Redis. It’s using native Tornado generator calls. Its Websocket demo provides example on how to use it in combination with pub/sub.

  • if you’re using Twisted, there is txRedis. There you also have pub/sub example.

  • it also seems that you can use Redis-py combined with Gevent with no problems using Gevent’s monkey patching (gevent.monkey.patch_all()).

UPDATE:
It’s been 5 years since the original answer, in the mean time Python got native async IO support. There now is AIORedis, an async IO Redis client.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)