Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler represents a handler for shutdown events
func InstallHandler ¶
InstallHandler installs a handler for syscall.SIGINT, syscall.SIGTERM
func (Handler) IsHealthy ¶
IsHealthy returns an error in case a shutdown is currently in progress. The error is returned to indicate that the service is not healthy any more (can't handle any requests)
func (*Handler) Register ¶ added in v0.0.5
Register a Stopable for shutdown handling. Per default the Stopable is added to the front of the list of Stopable's this means the Stopable that was the last one registered will be the first being called for shutdown. If you call Register(stopable,false) you can add this Stopable to the end of the list of registered Stopables.
func (*Handler) WaitUntilSignal ¶ added in v0.0.4
func (h *Handler) WaitUntilSignal()
WaitUntilSignal waits/ blocks until either syscall.SIGINT or syscall.SIGTERM was issued to the process
type Stopable ¶
type Stopable interface { // Stop will be called as soon as the shutdown signal was caught. // Hence within this method all teardown actions should be done (e.g. free resources, leave task main loops, ...) Stop() error // String ... to meet the Stringer interface String() string }
Stopable is a interface for runnable sokar components