You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sorry to bother you again. I don't know if this is a relevant use case, but I've noticed that subscription.unsubscribe only works within the with ... as client context manager: this means we can't stop the consumer from a callback (say after N messages have been consumed or a certain message is received, or even when a timeout occurs). AFAICT this happens because Client.__aexit__ waits for a Future that is never set (see [here]).
I'm wondering if we can change this behavior and set the Future result (or just use an asyncio.Event instead of a Future) when the last subscription has been removed. This could be implemented, for example, by converting ActiveSubscriptions into an "observable" dictionary that calls Event.cancel when a subscription is added and Event.set it when a subscription is deleted and there aren't any subscriptions left e.g.