rename orchestrator method start_polling to run_repl

This commit is contained in:
2026-02-10 14:03:37 +03:00
parent 6ed1d35e8a
commit de6d35205c
23 changed files with 79 additions and 81 deletions
+2 -2
View File
@@ -12,6 +12,6 @@ orchestrator = Orchestrator(
if __name__ == "__main__":
if arg_parser.parsed_argspace.get_by_name("dev"):
orchestrator.start_polling(App(initial_message="ArgentaDev"))
orchestrator.run_repl(App(initial_message="ArgentaDev"))
else:
orchestrator.start_polling(App())
orchestrator.run_repl(App())
+1 -1
View File
@@ -22,7 +22,7 @@ def main():
print(f" Host: {host.value}")
print(f" Port: {port.value}")
orchestrator.start_polling(app)
orchestrator.run_repl(app)
if __name__ == "__main__":
+1 -1
View File
@@ -24,4 +24,4 @@ orchestrator = Orchestrator(custom_providers=[ConnectionProvider()])
# 4. Start the application
if __name__ == "__main__":
orchestrator.start_polling(app)
orchestrator.run_repl(app)
@@ -60,7 +60,7 @@ orchestrator = Orchestrator()
def main():
app.include_router(router)
orchestrator.start_polling(app)
orchestrator.run_repl(app)
if __name__ == "__main__":
+1 -1
View File
@@ -9,7 +9,7 @@ orchestrator: Orchestrator = Orchestrator()
def main() -> None:
app.include_router(router)
orchestrator.start_polling(app)
orchestrator.run_repl(app)
if __name__ == "__main__":
+1 -1
View File
@@ -30,4 +30,4 @@ app.include_router(main_router)
# 5. Start application
if __name__ == "__main__":
orchestrator.start_polling(app)
orchestrator.run_repl(app)
@@ -15,4 +15,4 @@ app.include_router(router)
# 3. Start polling via orchestrator
if __name__ == "__main__":
orchestrator.start_polling(app)
orchestrator.run_repl(app)
+1 -1
View File
@@ -25,7 +25,7 @@ def test_input_incorrect_command(capsys: CaptureFixture[str]):
app.set_unknown_command_handler(lambda command: print(f"Unknown command: {command.trigger}"))
with patch("builtins.input", side_effect=["help", "q"]):
orchestrator.start_polling(app)
orchestrator.run_repl(app)
output = capsys.readouterr().out
assert "\nUnknown command: help\n" in output
+1 -1
View File
@@ -159,7 +159,7 @@ PredefinedMessages
app.add_message_on_startup(PredefinedMessages.AUTOCOMPLETE)
app.add_message_on_startup(PredefinedMessages.HELP)
orchestrator.start_polling(app)
orchestrator.run_repl(app)
if __name__ == "__main__":
main()
+1 -1
View File
@@ -36,7 +36,7 @@ Orchestrator
Основные методы
----------------
.. py:method:: start_polling(self, app: App) -> None
.. py:method:: run_repl(self, app: App) -> None
Это главный метод, который запускает приложение. Он запускает бесконечный цикл ввода -> вывода.
+1 -1
View File
@@ -45,7 +45,7 @@
E2E-тестирование цикла
----------------------
Полный запуск цикла ``start_polling`` можно покрывать через подпроцесс с передачей строк в ``stdin``. Это тяжелее и обычно не требуется. Если всё же необходимо — пример ниже.
Полный запуск цикла ``run_repl`` можно покрывать через подпроцесс с передачей строк в ``stdin``. Это тяжелее и обычно не требуется. Если всё же необходимо — пример ниже.
.. danger::
**Важно:** Обязательно передавайте строковый триггер команды выхода последним элементом в списке ``side_effects`` при патче ``input``.