timeutil

package
v0.0.0-...-1974178 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sleep

func Sleep(interval time.Duration, shutdownSignal <-chan struct{}) bool

Types

type Ticker

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

Ticker is task that gets executed repeatedly. It adjusts the intervals or drops ticks to make up for slow executions.

func NewTicker

func NewTicker(handler func(), interval time.Duration, optionalExternalShutdownSignal ...<-chan struct{}) (ticker *Ticker)

NewTicker creates a new Ticker from the given details. The interval must be greater than zero; if not, NewTicker will panic.

func (*Ticker) Shutdown

func (t *Ticker) Shutdown()

Shutdown shuts down the Ticker.

func (*Ticker) WaitForGracefulShutdown

func (t *Ticker) WaitForGracefulShutdown()

WaitForGracefulShutdown waits until the Ticker was shut down and the last handler has terminated.

func (*Ticker) WaitForShutdown

func (t *Ticker) WaitForShutdown()

WaitForShutdown waits until the Ticker was shut down.

Jump to

Keyboard shortcuts

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