`asyncio.wait(..., FIRST_COMPLETED)` returns with at least one of the two tasks done, so `receiver` missing from `done` already means `sender` is in it. The `elif sender not in done: continue` could never fire.
`asyncio.wait(..., FIRST_COMPLETED)` returns with at least one of the two tasks done, so `receiver` missing from `done` already means `sender` is in it. The `elif sender not in done: continue` could never fire.