MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / run_loop

Method run_loop

examples/server/server.py:15547–15565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15545 return cast(str, metrics)
15546
15547 def run_loop(self) -> None:
15548 while True:
15549 with self.condition:
15550 while not self.closed and not self.commands and self.scheduler.is_idle():
15551 self.condition.wait()
15552 if self.closed and not self.commands and self.scheduler.is_idle():
15553 return
15554 commands = list(self.commands)
15555 self.commands.clear()
15556 for command in commands:
15557 command()
15558 progressed = self.scheduler.step()
15559 if progressed:
15560 continue
15561 with self.condition:
15562 if self.closed and not self.commands and self.scheduler.is_idle():
15563 return
15564 if not self.commands:
15565 self.condition.wait(timeout=0.01)
15566
15567 def submit_request(
15568 self,

Callers

nothing calls this directly

Calls 2

is_idleMethod · 0.80
stepMethod · 0.80

Tested by

no test coverage detected