MCPcopy Create free account
hub / github.com/MLSysU/TD-Pipe / start_background_loop

Method start_background_loop

TD_Pipe/engine/async_llm_engine.py:285–296  ·  view source on GitHub ↗

Start the background loop.

(self)

Source from the content-addressed store, hash-verified

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"]:

Callers 1

add_requestMethod · 0.95

Calls 2

run_engine_loopMethod · 0.95
init_eventMethod · 0.80

Tested by

no test coverage detected