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 or None use_thread_output_queue option uses enabled. Explicit False always keeps the async sink; True selects queue_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 StatsThreadOutputQueue to preserve sink statistics.

Attributes

enabled

Whether omitted/None build options select the thread-backed sink.

queue_class

The class used when the thread-backed sink is enabled without an explicit class.

enabled: bool = True

Whether omitted/None build options select the thread-backed sink.

queue_class: type[ThreadOutputQueue]

The class used when the thread-backed sink is enabled without an explicit class.