(self, client_id)
| 652 | return set() |
| 653 | |
| 654 | async def cancel_task(self, client_id): |
| 655 | parent_task = self.tasks.pop(client_id, None) |
| 656 | if parent_task is None: |
| 657 | return |
| 658 | parent_task, _cmd, _args, _kwargs = parent_task |
| 659 | self.engine_debug(f"{self.name}: Cancelling client id {client_id} (task: {parent_task})") |
| 660 | parent_task.cancel() |
| 661 | child_tasks = self.child_tasks.pop(client_id, set()) |
| 662 | if child_tasks: |
| 663 | self.engine_debug(f"{self.name}: Cancelling {len(child_tasks):,} child tasks for client id {client_id}") |
| 664 | for child_task in child_tasks: |
| 665 | child_task.cancel() |
| 666 | |
| 667 | for task in [parent_task] + list(child_tasks): |
| 668 | await self._await_cancelled_task(task) |
| 669 | |
| 670 | async def _await_cancelled_task(self, task): |
| 671 | try: |
no test coverage detected