Skip to content

Commit

Permalink
Close on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
rad-pat committed Oct 31, 2023
1 parent c626d5b commit ccc7ba0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redis_stomp/pubsub/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def __init__(self, connection: StompConnection, redis_url: str):
self._closed = False
self._redis = connect(redis_url, decode_responses=True).pubsub(ignore_subscribe_messages=True)

async def disconnect(self, connection: StompConnection):
await super().disconnect(connection)
await self.close()

async def close(self):
self._closing = True
while not self._closed:
Expand Down

0 comments on commit ccc7ba0

Please sign in to comment.