MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / read_task_pid

Function read_task_pid

tests/utils/io.py:35–47  ·  view source on GitHub ↗

Reads the task's PID from its stdout.

(hq_env: HqEnv, job_id: int = 1)

Source from the content-addressed store, hash-verified

33
34
35def read_task_pid(hq_env: HqEnv, job_id: int = 1) -> int:
36 """
37 Reads the task's PID from its stdout.
38 """
39 wait_for_job_state(hq_env, job_id, "RUNNING")
40
41 def get_pid():
42 pid = read_file(default_task_output(job_id=job_id)).strip()
43 if not pid:
44 return None
45 return int(pid)
46
47 return wait_until(get_pid)

Callers 1

Calls 2

wait_for_job_stateFunction · 0.85
wait_untilFunction · 0.70

Tested by 1