Skip to content

Commit

Permalink
Merge pull request #9 from SomberNight/faster_tg_cancellation
Browse files Browse the repository at this point in the history
TaskGroup: faster cancellation
  • Loading branch information
Neil committed Dec 9, 2018
2 parents 9b701b2 + 9403e11 commit 294e9bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiorpcx/curio.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ def errored(task):
async def cancel_remaining(self):
'''Cancel all remaining tasks.'''
self._closed = True
for task in list(self._pending):
task_list = list(self._pending)
for task in task_list:
task.cancel()
for task in task_list:
with suppress(CancelledError):
await task

Expand Down

0 comments on commit 294e9bb

Please sign in to comment.