amphp/redis

Wrong behavior on single subscription unsubscribe

Opened this issue · 0 comments

If you have only one subscription and then unsubscribe from it, Amp\Redis\RedisSubscriber will become to invalid state.
Amp\Redis\RedisSubscription::unsubscribe internally calls Amp\Redis\RedisSubscriber::unloadEmitter which checks isIdle and disconnects but runnging flag stays true. So, if you want to get another subscription after it, Amp\Redis\RedisSubscriber::run won't be called (and it will not perform connect therefore) and 'Redis connection already closed' exception will be thrown.