leporo / tornado-redis

Asynchronous Redis client that works within Tornado IO loop.
667 stars 163 forks source link

How do I add and remove channel subscriptions using an existing pubsub connection? #38

Closed akiany closed 11 years ago

akiany commented 11 years ago

Could you provide an example? I would like to use the library, but can't find a way to dynamically add and remove channels I'd like my tornado-redis instance to listen to.

Thanks, Armin

leporo commented 11 years ago

Sorry for not replying earlier.

You may call the subscripe method at any time, even after entering the listen loop. Note that you need to unsubscribe from all channels you've previously subscribed to to exit the 'listen' loop.

It seems I should also add an example of handling disconnects.