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_sec alone does not force the process pool. The typed default is 900.0; coupling timeout to spawn would turn every workers=1 / backend="serial" run into a child process and erase the serial path. Per-subject timeout isolation still requires backend="process" or parallel_mode="isolated".

Parameters:

policy – Declarative execution policy.

Returns:

True when ProcessPoolBackend must be used.