websocket: add disconnect and stoppd event

This commit is contained in:
Jacob Plaster
2019-01-29 15:09:47 +00:00
parent 21890e5708
commit 5a6c2bbbef
3 changed files with 16 additions and 4 deletions

View File

@@ -72,6 +72,13 @@ class SubscriptionManager:
def get(self, chan_id):
return self.subscriptions_chanid[chan_id]
def set_all_unsubscribed(self):
"""
Sets all f the subscriptions ot state 'unsubscribed'
"""
for sub in self.subscriptions_chanid.values():
sub.confirm_unsubscribe()
async def unsubscribe(self, chan_id, onComplete=None):
"""
Unsubscribe from the channel with the given chanId