Documentation
¶
Overview ¶
Package proc manages the supervised glass child process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
Condition reports whether the supervised process should be started. If it returns false, reason is written to the output buffer.
type Option ¶
type Option func(*Supervisor)
Option configures a Supervisor.
func WithCondition ¶
WithCondition sets a condition that must pass before the process is started. The supervisor checks the condition before each start attempt, backing off exponentially (up to condMaxBackoff) between failed checks.
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
Supervisor starts and supervises a process, capturing its output.
func (*Supervisor) Follow ¶
func (s *Supervisor) Follow(ctx context.Context) <-chan string
Follow returns a channel that receives new log lines until ctx is cancelled.
func (*Supervisor) Info ¶
func (s *Supervisor) Info() Info
Info returns a snapshot of current supervisor state.
func (*Supervisor) Lines ¶
func (s *Supervisor) Lines() []string
Lines returns the current ring buffer contents in chronological order.
func (*Supervisor) Restart ¶
func (s *Supervisor) Restart()
Restart sends SIGTERM to the running process. The supervision loop restarts it.