From 4fd2f5469bf76362ba99afd76df0740a63c7f0cc Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Thu, 26 Feb 2026 00:24:02 +0800 Subject: [PATCH] fix: remove outdated stop_and_shutdown_loop from Worker docstring --- faust/worker.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/faust/worker.py b/faust/worker.py index 06533b77e..d17f1491f 100644 --- a/faust/worker.py +++ b/faust/worker.py @@ -156,9 +156,7 @@ class Worker(mode.Worker): >>> worker = Worker(app) >>> worker.execute_from_commandline() - 3) or if you already have an event loop, calling ``await start``, - but in that case *you are responsible for gracefully shutting - down the event loop*:: + 3) or if you already have an event loop, calling ``await start``:: async def start_worker(worker: Worker) -> None: await worker.start() @@ -166,10 +164,7 @@ async def start_worker(worker: Worker) -> None: def manage_loop(): loop = asyncio.get_event_loop_policy().get_event_loop() worker = Worker(app, loop=loop) - try: - loop.run_until_complete(start_worker(worker) - finally: - worker.stop_and_shutdown_loop() + loop.run_until_complete(start_worker(worker)) Arguments: app: The Faust app to start.