spdl.pipeline.defs.ExecutorConfig

class ExecutorConfig(max_workers: int | None = None, initializer: Callable[[...], object] | None = None, initargs: tuple[Any, ...] = ())[source]

[Experimental] Base spec for a worker-pool executor.

A serializable description of a pool of workers, materialized into a live executor by the pipeline. Subclassed by ProcessPoolExecutorConfig and InterpreterPoolExecutorConfig; those subclasses are used as .to() placement targets (via PlacementConfig).

Added in version 0.6.0.

Attributes

initargs

Positional arguments passed to initializer.

initializer

Callable run once in each worker before it processes any work.

max_workers

Number of workers.

initargs: tuple[Any, ...] = ()

Positional arguments passed to initializer.

initializer: Callable[[...], object] | None = None

Callable run once in each worker before it processes any work.

max_workers: int | None = None

Number of workers. If None, defaults to the number of CPUs.