package heartbeat

import "github.com/docker/swarmkit/manager/dispatcher/heartbeat"

Index

Types

type Heartbeat

type Heartbeat struct {
	// contains filtered or unexported fields
}

Heartbeat is simple way to track heartbeats.

func New

func New(timeout time.Duration, timeoutFunc func()) *Heartbeat

New creates new Heartbeat with specified duration. timeoutFunc will be called if timeout for heartbeat is expired. Note that in case of timeout you need to call Beat() to reactivate Heartbeat.

func (*Heartbeat) Beat

func (hb *Heartbeat) Beat()

Beat resets internal timer to zero. It also can be used to reactivate Heartbeat after timeout.

func (*Heartbeat) Stop

func (hb *Heartbeat) Stop()

Stop stops Heartbeat timer.

func (*Heartbeat) Update

func (hb *Heartbeat) Update(d time.Duration)

Update updates internal timeout to d. It does not do Beat.

Source Files

heartbeat.go

Version
v1.12.0 (latest)
Published
Jul 26, 2016
Platform
linux/amd64
Imports
2 packages
Last checked
6 hours ago

Tools for package owners.