runner
dev_tool.services.runner
__all__ = ['BaseProcessRunner']
module-attribute
BaseProcessRunner
Bases: ABC
An abstract base class for process runners.
This class handles the common process lifecycle including starting, streaming output, and stopping a subprocess.
The constructor for the BaseProcessRunner class.
Parameters:
-
project_name(str) –The project name for container naming.
Source code in dev_tool/services/runner/base.py
environment = {}
instance-attribute
output_thread = None
instance-attribute
process = None
instance-attribute
project_name = project_name
instance-attribute
ready_event = threading.Event()
instance-attribute
stop_event = threading.Event()
instance-attribute
run
A method that starts the subprocess and output thread.
Source code in dev_tool/services/runner/base.py
run_and_wait
A method that starts the subprocess and blocks until it exits or is interrupted.
Source code in dev_tool/services/runner/base.py
stop
A method that stops the subprocess and cleans up resources.
Source code in dev_tool/services/runner/base.py
wait_until_ready
A method that blocks until the process signals readiness or the timeout expires.
Parameters:
-
timeout(float, default:30.0) –The maximum time to wait in seconds.
Returns:
-
bool–True if the process is ready, False if the timeout was reached.