worker

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShutdown = errors.New("worker shut down")
View Source
var FatalError = errors.New("workload error")

Functions

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type Ticker

type Ticker struct {
	Interval time.Duration
	// contains filtered or unexported fields
}

func NewTicker

func NewTicker(l Workload, i time.Duration) *Ticker

func (*Ticker) Start

func (w *Ticker) Start()

func (*Ticker) Stop

func (w *Ticker) Stop()

type Workload

type Workload interface {
	Process() error
	Shutdown()
	IsShutdown() bool
}

Jump to

Keyboard shortcuts

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