PtcRunner.LiveStatus (PtcRunner v0.14.0)

Copy Markdown View Source

Opt-in live status reporting for one Kernel run.

PtcRunner.Kernel.Runner starts one internal reporter per run when either an owning host injects a per-run target or PTC_VIEWER_URL names an external Viewer. It samples public run state (RunState.usage/1, parallel-budget occupancy, sandbox heap) and sends self-contained frames to that target. PTC_VIEWER_TOKEN, when present, authenticates the HTTP form. Reporting is strictly best-effort: a dead, absent, or rejecting Viewer never affects the run.

Summary

Functions

Posts the final frame carrying the run outcome.

Starts the configured per-run or HTTP reporter; returns nil otherwise.

Stops the reporter; safe on nil and on an already-dead pid.

Functions

complete(reporter, phase, reason, limit, last_evaluation_error \\ nil)

@spec complete(pid() | nil, atom(), term(), binary() | nil, map() | nil) :: :ok

Posts the final frame carrying the run outcome.

maybe_start(config, run_state)

@spec maybe_start(struct(), struct()) :: pid() | nil

Starts the configured per-run or HTTP reporter; returns nil otherwise.

stop(pid)

@spec stop(pid() | nil) :: :ok

Stops the reporter; safe on nil and on an already-dead pid.