Skip to content

Commit 9b91b98

Browse files
committed
AsyncSequencerClient: handle only 1 input at time
Sometimes the I/O callback could be called more than once before the future is read (why?) – ignore those calls.
1 parent ff97068 commit 9b91b98

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

alsa_midi/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,8 @@ async def event_input(self, prefer_bytes: bool = False, timeout: Optional[float]
17961796
fd = self._fd
17971797

17981798
def reader_cb():
1799+
if fut.done():
1800+
return
17991801
result = None
18001802
try:
18011803
result, event = self._event_input(prefer_bytes=prefer_bytes)
@@ -1839,6 +1841,8 @@ async def _event_output_wait(self, func, timeout: Optional[float] = None) -> Uni
18391841
fd = self._fd
18401842

18411843
def writer_cb():
1844+
if fut.done():
1845+
return
18421846
nonlocal remainder
18431847
result = None
18441848
try:

0 commit comments

Comments
 (0)