PipelineTask: only call event handlers if a filter is matched

This commit is contained in:
Aleix Conchillo Flaqué
2025-03-13 18:39:11 -07:00
parent 676c5d9ba7
commit 1b3b4ee04a
3 changed files with 47 additions and 5 deletions

View File

@@ -102,6 +102,8 @@ class TestPipelineTask(unittest.IsolatedAsyncioTestCase):
pipeline = Pipeline([identity])
task = PipelineTask(pipeline)
task.set_event_loop(asyncio.get_event_loop())
task.set_reached_upstream_filter((TextFrame,))
task.set_reached_downstream_filter((TextFrame,))
@task.event_handler("on_frame_reached_upstream")
async def on_frame_reached_upstream(task, frame):