spdl.pipeline.config.ThreadOutputQueueConfig¶
- class ThreadOutputQueueConfig(*, enabled: bool = True, queue_class: type[~spdl.pipeline._components._thread_queue.ThreadOutputQueue] = <factory>)[source]¶
Process-local defaults for selecting the final pipeline sink.
Configure the sink explicitly with
set_default_thread_output_queue_config()rather than changing build-function keyword defaults. An omitted orNoneuse_thread_output_queueoption usesenabled. ExplicitFalsealways keeps the async sink;Trueselectsqueue_class; a caller’s explicit queue class takes priority over this configuration.Configure defaults before building pipelines. Existing pipelines retain their queue instances. Internal stage queues and task hooks are independent.
Example:
from spdl.pipeline import StatsThreadOutputQueue from spdl.pipeline.config import ( ThreadOutputQueueConfig, set_default_thread_output_queue_config, ) set_default_thread_output_queue_config( ThreadOutputQueueConfig( enabled=True, queue_class=StatsThreadOutputQueue ) )
Added in version 0.9.0.
Changed in version 0.9.0: The initial configuration enables the thread sink and uses
StatsThreadOutputQueueto preserve sink statistics.Attributes
Whether omitted/None build options select the thread-backed sink.
The class used when the thread-backed sink is enabled without an explicit class.
- queue_class: type[ThreadOutputQueue]¶
The class used when the thread-backed sink is enabled without an explicit class.