Async loop migration.
(self)
| 525 | self.has_runable_event.set() |
| 526 | |
| 527 | async def migration_loop(self): |
| 528 | """Async loop migration.""" |
| 529 | while not self.stop_event.is_set(): |
| 530 | if self._sleep_requested: |
| 531 | self.migration_event.clear() |
| 532 | self._migration_sleep_drain_event.set() |
| 533 | await self._sleep_resume_event.wait() |
| 534 | continue |
| 535 | |
| 536 | migration_ready = self.scheduler._schedule_migration() |
| 537 | if not migration_ready and not self.scheduler.has_migration_waiting(): |
| 538 | await self.migration_event.wait() |
| 539 | elif migration_ready: |
| 540 | self.migration_event.clear() |
| 541 | await self._migration_loop_process_ready(migration_ready) |
| 542 | else: |
| 543 | # release coroutine for decoding |
| 544 | await asyncio.sleep(.5) |
| 545 | |
| 546 | def start(self, event_loop: asyncio.AbstractEventLoop): |
| 547 | """Create async tasks.""" |
no test coverage detected