ticker

package
v0.0.0-...-7847555 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ticker

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

Ticker is a background ticker.

func New

func New(d time.Duration, f func() error) *Ticker

New starts a background ticker with a period specified by the duration argument, that will call the given function f on each tick. It is the caller's responsibility to ensure that the returned ticker is stopped via its Stop method, otherwise resources may leak.

func (*Ticker) Reset

func (t *Ticker) Reset()

Reset resets the ticker. This has no effect on a previously stopped ticker.

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop stops the ticker, releasing any resources used by the ticker.

Jump to

Keyboard shortcuts

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