Skip to content

Commit a771ae8

Browse files
authored
Apply suggestions from code review
1 parent 1c67482 commit a771ae8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

utils/subprocess/supervisor/interface.go

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import "context"
44

55
//go:generate mockgen -destination=../../mocks/mock_$GOPACKAGE.go -package=mocks github.com/ARM-software/golang-utils/utils/subprocess/$GOPACKAGE ISupervisor
66

7+
// ISupervisor will run a command and automatically restart it if it exits. Hooks can be used to execute code at
8+
// different points in the execution lifecyle. Restarts can be delayed
79
type ISupervisor interface {
10+
// Run will run the supervisor and execute any of the command hooks. If it receives a halting error or the context is cancelled then it will exit
811
Run(ctx context.Context) error
912
}

utils/subprocess/supervisor/supervisor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func WithPostStop(function func(context.Context, error) error) SupervisorOption
6161
}
6262
}
6363

64-
// WithHaltingErrors are errors that won't trigger the supervisor to restart
64+
// WithHaltingErrors are errors that won't trigger the supervisor to restart and on which, the subprocess will just halt.
6565
func WithHaltingErrors(errs ...error) SupervisorOption {
6666
return func(s *Supervisor) {
6767
s.haltingErrors = errs

0 commit comments

Comments
 (0)