Documentation
¶
Overview ¶
Package taskwatch implements live streaming output tailing for a running cloop PM task. It polls the live artifact file written by the orchestrator and streams new bytes to an io.Writer, similar to `tail -f`.
Index ¶
Constants ¶
View Source
const ( ExitDone = 0 ExitFailed = 1 ExitSkipped = 2 )
ExitCode encodes the terminal task status as a process exit code.
Variables ¶
This section is empty.
Functions ¶
func Watch ¶
Watch tails live output for a running task identified by cfg.TaskID.
Behaviour:
- If the task is pending, it waits up to cfg.Timeout for it to become in_progress.
- While the task is in_progress it streams new bytes from the live artifact file every 100 ms.
- When the task reaches a terminal status (done/failed/skipped/timed_out) it prints a final status banner, fires a desktop notification (unless cfg.NoNotify is true) and returns the appropriate exit code.
Returns (exitCode, error).
Types ¶
type Config ¶
type Config struct {
WorkDir string
TaskID int
Timeout time.Duration // max time to wait for the task to start; default 5m
NoNotify bool // suppress desktop notification on completion
Output io.Writer // where to stream output; defaults to os.Stdout
}
Config controls the behaviour of Watch.
Click to show internal directories.
Click to hide internal directories.