Documentation ¶
Overview ¶
Package ping provides a mechanism for pinging a set of servers in parallel to identify responsive ones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PingInParallel ¶
func PingInParallel(ctx *context.T, names []string, timeout, channelTimeout time.Duration) (map[string]PingResult, error)
PingInParallel attempts to make a connection in parallel to all specified names, waits for some time, then returns a map of name to PingResult.
- 'timeout' is the maximum duration that PingInParallel will wait before cancelling any outstanding calls and returning.
- 'channelTimeout' is the channelTimeout that will be used for healthchecks on any created connections.
Notes:
- PingInParallel may report erroneous ping latencies if the system clock changes during the call. Clients must be resilient to such errors.
Types ¶
type PingResult ¶
type PingResult struct { Name string // name that was pinged Err error // either a connection error or a timeout/canceled error Conn flow.PinnedConn // the PinnedConn to the remote end. }
PingResult is the result of a single ping.
Click to show internal directories.
Click to hide internal directories.