Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_MAX_TRY_COUNT = 3 DEFAULT_POST_START_BURST_PAUSE_DURATION = 5 * time.Minute NEW_PROCESS_PID_LOG_FIELD_NAME = "newProcessPID" )
Variables ¶
This section is empty.
Functions ¶
func AutoRestart ¶
func AutoRestart(args AutoRestartArgs) error
AutoRestart starts a restart loop in the calling goroutine, during a single step args.MakeCommand is called and the returned command is started.
func KillHiearachy ¶
Types ¶
type AutoRestartArgs ¶
type AutoRestartArgs struct { GoCtx context.Context MakeCommand func(goCtx context.Context) *exec.Cmd Logger zerolog.Logger ProcessNameInLogs string //defaults to DEFAULT_MAX_TRY_COUNT MaxTryCount int //optional, an item is written to this channel each time a created process exits. ExitEventChan chan struct{} //optional, each time a process is started its PID is written to the channel. StartEventChan chan int32 //duration of the pause following a burst of failed starts, defaults to DEFAULT_POST_START_BURST_PAUSE_DURATION. PostStartBurstPauseDuration time.Duration //optional, the value is set to true when the autorestart is paused PostStartBurstPause *atomic.Bool }
Click to show internal directories.
Click to hide internal directories.