Documentation
¶
Overview ¶
Package waitregistry records outstanding delegated waits so that someone other than the waiting process can see them.
A wait that exists only as a background process in one harness's memory has moved the "did anyone remember this?" problem rather than solved it: an agent that correctly delegates its waiting goes quiet, and a quiet session is indistinguishable from a crashed one. The only recourse available to a watching human is to interrupt, which destroys the quiet that delegating the wait exists to create.
This is deliberately not a watch service. It stores no events, delivers nothing, and wakes nobody. It answers one question — what is this session waiting for, since when, and how would it resume — and forgets the answer when the wait ends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Alive = func(pid int) bool { if pid <= 0 { return false } return session.ProcessAlive(pid) }
Alive reports whether a process still exists. It delegates to WB's existing per-platform liveness check rather than reimplementing one: an earlier hand-rolled version used Process.Signal(nil), which always fails Go's signal type assertion, so every live waiter was reported as stale.
It is a variable so tests can decide liveness without spawning processes.
Functions ¶
Types ¶
type Record ¶
type Record struct {
Schema int `json:"schema"`
ID string `json:"id"`
PID int `json:"pid"`
WBSessionID string `json:"wb_session_id,omitempty"`
Kind string `json:"kind"`
Targets []string `json:"targets"`
Until string `json:"until"`
StartedAt time.Time `json:"started_at"`
Deadline time.Time `json:"deadline,omitempty"`
ResumeArgs []string `json:"resume_args,omitempty"`
// Stale marks a record whose process is gone. It is never persisted; List
// derives it, because a wait that died without clearing its record is
// exactly the thing worth seeing.
Stale bool `json:"stale,omitempty"`
}
Record is one outstanding wait. It holds no provider payloads, no credentials, and no prompt text: only what is needed to answer "who is waiting for what, and how does it resume".