tornado-redis
tornado-redis copied to clipboard
Ensure that there are no subscribers if there is no Redis connection
I experienced issues if my Redis server was restarted: the list of subscribers didn't change while there was no subscription to a channel in Redis.
By resetting the subscribers if there is no connection we ensure that there will be a subscription to a channel in Redis (rather than piling up subscribers that will never receive a message).
(Not all tests were passing when I ran the tests before I applied this so I don't think this will break anything)
These kinds of bugs are somewhat concerning for the state of the library. The loss of connection and handling these cases is fundamental to a library such as this.
I believe some kind of test suite which stresses the library in the face of connection loss needs to be implemented.