async-job-watcher
Spawn a detached background export job, poll its status file until READY, verify the exported artifact checksum, and always clean up temporary status files using examples/async_job_watcher/actions.py.
작성자를 위한 경고
- "name" should match the name of the directory that holds SKILL.md
- Not listed through the skills extension: the directory must be named after the skill.
Async Background Job Watcher (async_job_watcher)
Executes the 4-stage asynchronous job polling and guaranteed cleanup workflow
using examples/async_job_watcher/actions.py.
Workflow Stages & Rules
-
Stage 1 — Spawn Background Job (
spawn_background_job):- Call
actions.spawn_background_job(payload)with{"delay_seconds": 1.0, "status_file": "<path>"}. - Returns
(out_dict, msg)whereout_dictis{"status_file": str, "target_delay_seconds": float, "worker_pid": int}. - Store
out_dictunderpayload["outputs"]["spawn_background_job"].
- Call
-
Stage 2 — Poll Until Ready (
await_job_completion):- Poll
actions.check_job_status_file(payload)in a loop every1.0second (up to30.0seconds timeout) untilout_dict["job_status"] == "READY". - Each tick returns
({"job_status": str, "progress_pct": int, "artifact_rows": int, "artifact_sha256": str}, msg). - Store the final tick's
out_dictunderpayload["outputs"]["await_job_completion"].
- Poll
-
Stage 3 — Verify Exported Artifact (
verify_exported_artifact):- Once
job_status == "READY", callactions.verify_exported_artifact(payload)withpayload["outputs"]["await_job_completion"]populated. - Raises
RuntimeErrorifartifact_rows <= 0orartifact_sha256is empty; otherwise returns({"verified": True, "artifact_rows": int, "artifact_sha256": str}, msg).
- Once
-
Stage 4 — Guaranteed Cleanup (
cleanup_job_status_file,ALL_DONE):- Trigger Rule (
ALL_DONE): Must execute inside afinally:block whether Stages 2–3 succeeded or raised an exception. - Call
actions.cleanup_job_status_file(payload)to removestatus_fileandstatus_file + ".tmp".
- Trigger Rule (
이 스킬의 파일
이 스킬에는 보조 파일이 없습니다.