frames: add EndTaskFrame and CancelTaskFrame

This commit is contained in:
Aleix Conchillo Flaqué
2024-09-24 19:10:22 -07:00
parent 31b5667cee
commit ee3786fe15
3 changed files with 39 additions and 2 deletions

View File

@@ -339,6 +339,27 @@ class FatalErrorFrame(ErrorFrame):
fatal: bool = field(default=True, init=False)
@dataclass
class EndTaskFrame(SystemFrame):
"""This is used to notify the pipeline task that the pipeline should be
closed nicely (flushing all the queued frames) by pushing an EndFrame
downstream.
"""
pass
@dataclass
class CancelTaskFrame(SystemFrame):
"""This is used to notify the pipeline task that the pipeline should be
stopped immediately by pushing a CancelFrame downstream.
"""
pass
@dataclass
class StopTaskFrame(SystemFrame):
"""Indicates that a pipeline task should be stopped but that the pipeline