Documentation ¶
Overview ¶
The restart package implements common restart strategies for ifrit processes.
The API is still experimental and subject to change.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoLoadCallback = errors.New("ErrNoLoadCallback")
ErrNoLoadCallback is returned by Restarter if it is Invoked without a Load function.
Functions ¶
Types ¶
type Restarter ¶
type Restarter struct { Runner ifrit.Runner Load func(runner ifrit.Runner, err error) ifrit.Runner }
Restarter takes an inital runner and a Load function. When the inital Runner exits, the load function is called. If the Load function retuns a Runner, the Restarter will invoke the Runner. This continues until the Load function returns nil, or the Restarter is signaled to stop. The Restarter returns the error of the final Runner it invoked.
Click to show internal directories.
Click to hide internal directories.