FrameProcessor: system frames are now queued
System frames are now queued. Before, system frames could be generated from any task and would not guarantee any order which was causing undesired behavior. Also, it was possible to get into some rare recursion issues because of the way system frames were executed (they were executed in-place, meaning calling `push_frame()` would finish after the system frame traversed all the pipeline). This makes system frames more deterministic.
This commit is contained in:
@@ -121,8 +121,8 @@ class Frame:
|
||||
class SystemFrame(Frame):
|
||||
"""System frame class for immediate processing.
|
||||
|
||||
System frames are frames that are not internally queued by any of the
|
||||
frame processors and should be processed immediately.
|
||||
A frame that takes higher priority than other frames. System frames are
|
||||
handled in order and are not affected by user interruptions.
|
||||
"""
|
||||
|
||||
pass
|
||||
@@ -132,8 +132,9 @@ class SystemFrame(Frame):
|
||||
class DataFrame(Frame):
|
||||
"""Data frame class for processing data in order.
|
||||
|
||||
Data frames are frames that will be processed in order and usually
|
||||
contain data such as LLM context, text, audio or images.
|
||||
A frame that is processed in order and usually contains data such as LLM
|
||||
context, text, audio or images. Data frames are cancelled by user
|
||||
interruptions.
|
||||
"""
|
||||
|
||||
pass
|
||||
@@ -143,9 +144,11 @@ class DataFrame(Frame):
|
||||
class ControlFrame(Frame):
|
||||
"""Control frame class for processing control information in order.
|
||||
|
||||
Control frames are frames that, similar to data frames, will be processed
|
||||
in order and usually contain control information such as frames to update
|
||||
settings or to end the pipeline.
|
||||
A frame that, similar to data frames, is processed in order and usually
|
||||
contains control information such as update settings or to end the pipeline
|
||||
after everything is flushed. Control frames are cancelled by user
|
||||
interruptions.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
@@ -1206,7 +1209,7 @@ class EndFrame(ControlFrame):
|
||||
should be shut down. If the transport receives this frame, it will stop
|
||||
sending frames to its output channel(s) and close all its threads. Note,
|
||||
that this is a control frame, which means it will be received in the order it
|
||||
was sent (unlike system frames).
|
||||
was sent.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user