jade.utils.subprocess_manager.SubprocessManager

class jade.utils.subprocess_manager.SubprocessManager[source]

Bases: object

Allows non-blocking execution of a command in a subprocess.

Methods

in_progress()

Returns True if commands are still running.

run(command[, timeout])

Run a command without blocking.

terminate()

Terminates the command.

wait_for_completion()

Waits until the command is complete.

Attributes

return_code

Return the return coe of the last completed command.

in_progress()[source]

Returns True if commands are still running.

property return_code

Return the return coe of the last completed command.

Returns:

Returns None if the command did not complete.

Return type:

int | None

run(command, timeout=None)[source]

Run a command without blocking. Call wait_for_completion() or in_progress() to monitor progress.

Parameters:
  • command (str) – Command to execute

  • timeout (int or None) – Timeout in seconds for each command. None means no timeout.

Raises:

JobAlreadyInProgress – Raised if execution is already in progress.

terminate()[source]

Terminates the command.

wait_for_completion()[source]

Waits until the command is complete.

Returns:

return code if the command completed, otherwise None

Return type:

int | None