Rename PipelineRunner.add_worker() to variadic add_workers(*workers)
Lets callers register multiple workers in a single call instead of awaiting add_worker() repeatedly. Updates all examples, docs, tests, and proxy worker docstrings to use the new API.
This commit is contained in:
@@ -103,8 +103,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
||||
|
||||
assistant = AcmeAssistant()
|
||||
|
||||
await runner.add_worker(proxy)
|
||||
await runner.add_worker(assistant)
|
||||
await runner.add_workers(proxy, assistant)
|
||||
|
||||
logger.info("Assistant server ready, waiting for activation")
|
||||
await runner.run()
|
||||
|
||||
@@ -146,8 +146,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
||||
logger.info("Client disconnected")
|
||||
await runner.cancel()
|
||||
|
||||
await runner.add_worker(proxy)
|
||||
await runner.add_worker(worker)
|
||||
await runner.add_workers(proxy, worker)
|
||||
|
||||
await runner.run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user