Make PipelineTask.add_observer() synchronous. This allows callers to call it before run()ning the PipelineTask first. Without this change, if they tried to do that, they would get an error because the TaskManager's event loop hadn't been set yet.
This commit is contained in:
@@ -142,7 +142,7 @@ class TestPipelineTask(unittest.IsolatedAsyncioTestCase):
|
||||
observer = CustomAddObserver()
|
||||
# Wait after the pipeline is started and add an observer.
|
||||
await asyncio.sleep(0.1)
|
||||
await task.add_observer(observer)
|
||||
task.add_observer(observer)
|
||||
# Push a TextFrame and wait for the observer to pick it up.
|
||||
await task.queue_frame(TextFrame(text="Hello Downstream!"))
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
Reference in New Issue
Block a user