From 1e939febc2491fbe1d1e7f97a48e424e8bd0cc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20K=C3=B6ssler?= Date: Wed, 21 Aug 2024 17:02:04 +0200 Subject: [PATCH] refactor: function naming --- pyinfra/examples.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pyinfra/examples.py b/pyinfra/examples.py index 69f83dc..558d88c 100644 --- a/pyinfra/examples.py +++ b/pyinfra/examples.py @@ -20,16 +20,11 @@ from pyinfra.webserver.utils import ( ) -async def run_async_tasks(manager, webserver): +async def run_async_queues(manager, webserver): """Run the webserver and the async queue manager concurrently.""" - - # Start the web server as an async task webserver_task = asyncio.create_task(webserver) - - # Start the async queue manager queue_manager_task = asyncio.create_task(manager.run()) - # Wait for both tasks to complete (typically, they run indefinitely) await asyncio.gather(webserver_task, queue_manager_task) @@ -88,7 +83,7 @@ def start_standard_queue_consumer( if isinstance(manager, AsyncQueueManager): webserver = create_webserver_task_from_settings(app, settings) - asyncio.run(run_async_tasks(manager, webserver)) + asyncio.run(run_async_queues(manager, webserver)) elif isinstance(manager, QueueManager): webserver = create_webserver_thread_from_settings(app, settings) webserver.start()