Attention
This project is still in an early phase of development.
The python API is not yet stable, and some aspects of the schema for the blueprint and workplan will likely evolve. Therefore whilst you are welcome to try out using the package, we cannot yet guarantee backwards compatibility. We expect to reach a more stable version in 2026.
LocalProcess#
- class cstar.execution.local_process.LocalProcess(commands: str, output_file: str | Path | None = None, run_path: str | Path | None = None)#
Bases:
ExecutionHandlerExecution handler for managing and monitoring local subprocesses.
This class handles the execution of commands as local subprocesses, allowing users to monitor their status, stream output, and manage lifecycle events such as cancellation.
- commands#
The shell command(s) to be executed as a subprocess.
- Type:
str
- run_path#
The directory from which the subprocess will be executed.
- Type:
Path
- output_file#
The file where the subprocess’s standard output and error will be written.
- Type:
Path
- status#
The current status of the subprocess, represented as an ExecutionStatus enum value.
- Type:
ExecutionStatus
- start()#
Start the subprocess using the specified command.
- cancel()#
Cancel the running subprocess.
- updates(seconds=10)#
Stream live updates from the subprocess’s output file for a specified duration.
Methods
Cancel the local process.
Start the local process.
LocalProcess.updates([seconds])Stream live updates from the task's output file.
Wait for the local process to finish.
Attributes
LocalProcess.logReturn the logger instance for this class.
The file in which to write this task's STDOUT and STDERR.
Retrieve the current status of the local process.