should_use_process_pool
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- should_use_process_pool(policy: RunPolicy) bool[source]
Return whether the policy requires a spawn process-pool backend.
Process pool is selected when any of the following hold:
backend == "process"(explicit request)workers > 1(subject-level parallelism)parallel_mode == "isolated"(fresh child per subject)
A positive
subject_timeout_secalone does not force the process pool. The typed default is900.0; coupling timeout to spawn would turn everyworkers=1/backend="serial"run into a child process and erase the serial path. Per-subject timeout isolation still requiresbackend="process"orparallel_mode="isolated".- Parameters:
policy – Declarative execution policy.
- Returns:
TruewhenProcessPoolBackendmust be used.