Skip to content

Commit

Permalink
fix(client): Fix cleanup of Client._waiters dict
Browse files Browse the repository at this point in the history
  • Loading branch information
qweeze committed Sep 21, 2023
1 parent b57963a commit 69e8945
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rstream/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ async def _listener(self) -> None:
break

logger.debug("Received frame: %s", frame)
_key = frame.key, frame.corr_id

while self._waiters[_key]:
fut = self._waiters[_key].pop()
fut.set_result(frame)
_key = frame.key, frame.corr_id
waiters = self._waiters.get(_key)
if waiters is not None:
for fut in waiters:
fut.set_result(frame)
del self._waiters[_key]

for _, handler in self._handlers.get(frame.__class__, {}).items():
try:
Expand Down

0 comments on commit 69e8945

Please sign in to comment.