heartbeat

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(
	every time.Duration,
	h Hearbeater,
	lastHeartbeatACK *atomic.Int64,
	stop chan struct{},
	errReporter func(err error),
)

Run periodically calls the given heartbeater to send a heartbeat payload. It can be stopped by closing the stop channel and will report any error that occurs using the given errReporter.

func RunUDP

func RunUDP(
	every time.Duration,
	h Hearbeater,
	lastUDPHeartbeatACK *atomic.Int64,
	stop chan struct{},
	errReporter func(err error),
)

RunUDP periodically calls the given heartbeater to send a heartbeat packet. It can be stopped by closing the stop channel and will report any error that occurs using the given errReporter.

Types

type Hearbeater

type Hearbeater func() error

Hearbeater is a function that sends a heartbeat.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL