Monitoring
provide.foundation.process.lifecycle.monitoring
¶
TODO: Add module docstring.
Classes¶
Functions¶
wait_for_process_output
async
¶
wait_for_process_output(
process: ManagedProcess,
expected_parts: list[str],
timeout: float = DEFAULT_PROCESS_WAIT_TIMEOUT,
buffer_size: int = 1024,
) -> str
Wait for specific output pattern from a managed process.
This utility reads from a process stdout until a specific pattern (e.g., handshake string with multiple pipe separators) appears.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
ManagedProcess
|
The managed process to read from |
required |
expected_parts
|
list[str]
|
List of expected parts/separators in the output |
required |
timeout
|
float
|
Maximum time to wait for the pattern |
DEFAULT_PROCESS_WAIT_TIMEOUT
|
buffer_size
|
int
|
Size of read buffer |
1024
|
Returns:
| Type | Description |
|---|---|
str
|
The complete output buffer containing the expected pattern |
Raises:
| Type | Description |
|---|---|
ProcessError
|
If process exits unexpectedly |
TimeoutError
|
If pattern is not found within timeout |