Start the background loop.
(self)
| 283 | and not self.background_loop.done()) |
| 284 | |
| 285 | def start_background_loop(self) -> None: |
| 286 | """Start the background loop.""" |
| 287 | if self.is_running: |
| 288 | raise RuntimeError("Background loop is already running.") |
| 289 | self._request_tracker.init_event() |
| 290 | |
| 291 | self._background_loop_unshielded = asyncio.get_event_loop( |
| 292 | ).create_task(self.run_engine_loop()) |
| 293 | self._background_loop_unshielded.add_done_callback( |
| 294 | partial(_raise_exception_on_finish, |
| 295 | request_tracker=self._request_tracker)) |
| 296 | self.background_loop = asyncio.shield(self._background_loop_unshielded) |
| 297 | |
| 298 | def _init_engine(self, *args, |
| 299 | **kwargs) -> Union[_AsyncLLMEngine, "ray.ObjectRef"]: |
no test coverage detected