Backends¶
- class ExecutorBackend(value)[source]¶
Bases:
StrEnumEnum representing the available executor backends.
- Parameters:
StrEnum (_type_) – String-based enum for executor backends.
- THREAD = 'thread'¶
- PROCESS = 'process'¶
- INTERPRETER = 'interpreter'¶
Backend helpers¶
- class ExecutorBackend(value)[source]¶
Bases:
StrEnumEnum representing the available executor backends.
- Parameters:
StrEnum (_type_) – String-based enum for executor backends.
- THREAD = 'thread'¶
- PROCESS = 'process'¶
- INTERPRETER = 'interpreter'¶
- normalize_backend(backend)[source]¶
Normalize the backend to an ExecutorBackend enum.
- Parameters:
backend (ExecutorBackend | str) – The backend to normalize.
- Raises:
ValueError – If the backend is not supported.
- Returns:
The normalized backend.
- Return type:
- resolve_executor_cls(backend)[source]¶
Resolve the executor class for the given backend.
- Parameters:
backend (ExecutorBackend | str) – The backend to resolve.
- Raises:
UnsupportedBackendError – If the backend is not supported.
UnsupportedBackendError – If the InterpreterPoolExecutor is not available.
- Returns:
The executor class for the given backend.
- Return type:
type[Executor]