prefect.utilities.processutils
forward_signal_handler(pid, signum, *signums, process_name, print_fn)
Forward subsequent signum events (e.g. interrupts) to respective signums.
Source code in src/prefect/utilities/processutils.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
|
open_process(command, **kwargs)
async
Like anyio.open_process
but with:
- Support for Windows command joining
- Termination of the process on exception during yield
- Forced cleanup of process resources during cancellation
Source code in src/prefect/utilities/processutils.py
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 |
|
run_process(command, stream_output=False, task_status=None, task_status_handler=None, **kwargs)
async
Like anyio.run_process
but with:
- Use of our
open_process
utility to ensure resources are cleaned up - Simple
stream_output
support to connect the subprocess to the parent stdout/err - Support for submission with
TaskGroup.start
marking as 'started' after the process has been created. When used, the PID is returned to the task status.
Source code in src/prefect/utilities/processutils.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
setup_signal_handlers_agent(pid, process_name, print_fn)
Handle interrupts of the agent gracefully.
Source code in src/prefect/utilities/processutils.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
|
setup_signal_handlers_server(pid, process_name, print_fn)
Handle interrupts of the server gracefully.
Source code in src/prefect/utilities/processutils.py
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
setup_signal_handlers_worker(pid, process_name, print_fn)
Handle interrupts of workers gracefully.
Source code in src/prefect/utilities/processutils.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|