Documentation ¶
Overview ¶
Package heartbeat provides a mechanism for heartbeating against Redis to ensure it's still healthy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heart ¶
type Heart struct { // Done is closed when the Heart has stopped (due to Redis failure) Done <-chan struct{} // contains filtered or unexported fields }
Heart is the thing that beats.
func New ¶
New is a function with an argument list that's roughly the size of Texas. The appName and UID are used as part of the key written to Redis. The warn and fail durations control when we log a warning, and when we start to exit (respectively). Finally, there's a shutdownFn if you want to clean up some things before the program exits. That function has 10 seconds to complete, otherwise the program is forcibly exited.
If the error is not nil, the *Heart is beating.
Click to show internal directories.
Click to hide internal directories.