Skip to content

Commit

Permalink
Drain the buffer from the notify receive socket whenever it's flagged…
Browse files Browse the repository at this point in the history
… as readable
  • Loading branch information
agronholm committed Dec 2, 2024
1 parent 7274d34 commit e138761
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/anyio/_core/_asyncio_selector_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ def run(self) -> None:
while not self._closed:
for key, events in self._selector.select():
if key.fileobj is self._receive:
self._receive.recv(4096)
while True:
try:
self._receive.recv(4096)
except BlockingIOError:
break

continue

if events & EVENT_READ:
Expand Down

0 comments on commit e138761

Please sign in to comment.