Stop all loops.
(self)
| 585 | await cancel_async_tasks(tasks) |
| 586 | |
| 587 | def stop(self): |
| 588 | """Stop all loops.""" |
| 589 | if self.stop_event.is_set(): |
| 590 | # Already stopped, avoid calling executor.stop() multiple times |
| 591 | return |
| 592 | self.executor.stop() |
| 593 | self.stop_event.set() |
| 594 | self.cancel() |
| 595 | |
| 596 | def cancel(self): |
| 597 | """Cancel all loops.""" |