Monitoring
π€ AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
provide.foundation.process.lifecycle.monitoring
¶
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 |
Source code in provide/foundation/process/lifecycle/monitoring.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |