Process Module API Reference¶
This section documents the internals of the process
module in Bijux CLI.
bijux_cli.contracts.process ¶
Defines the contract for a worker process pool service.
This module specifies the ProcessPoolProtocol
, a formal interface that any service managing a pool of worker processes for command execution must implement. This allows for abstracting the details of subprocess management.
ProcessPoolProtocol ¶
Bases: Protocol
Defines the contract for a worker process pool.
This interface specifies the methods for running commands in isolated worker processes and managing the lifecycle of the pool.
get_status ¶
Returns the current status of the process pool.
Returns:
-
dict[str, Any]
–dict[str, Any]: A dictionary containing status information, such as the number of active workers, queue size, etc.
run ¶
Executes a command in a worker process.
Parameters:
-
cmd
(list[str]
) –A list of command arguments to execute.
-
executor
(str
) –The name or identifier of the executor to use.
Returns:
-
tuple[int, bytes, bytes]
–tuple[int, bytes, bytes]: A tuple containing the return code, standard output (stdout), and standard error (stderr) as bytes.