Deprecate passing a worker to PipelineRunner.run()
Register the worker with PipelineRunner.add_workers() before calling run() instead. The worker argument still works but now emits a DeprecationWarning and will be removed in a future release. Update the runner docstrings, the run_test() helper, and all examples (including the asyncio.gather() forms) to use the new pattern.
This commit is contained in:
@@ -165,7 +165,8 @@ class TestBusBridgeProcessor(unittest.IsolatedAsyncioTestCase):
|
||||
await worker.queue_frame(EndFrame())
|
||||
|
||||
runner = PipelineRunner()
|
||||
await asyncio.gather(runner.run(worker), inject_and_end())
|
||||
await runner.add_workers(worker)
|
||||
await asyncio.gather(runner.run(), inject_and_end())
|
||||
|
||||
texts = [f.text for f in received if isinstance(f, TextFrame)]
|
||||
self.assertIn("from_child", texts)
|
||||
|
||||
Reference in New Issue
Block a user