worker

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(stop <-chan struct{}) error

Action is the shorthand to `func(stop <-chan struct{}) error`

type Worker

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

Worker simplifies usage of the lock

func NewWorker

func NewWorker(name string, logger moira.Logger, lock moira.Lock, action Action) *Worker

NewWorker creates Worker

func (*Worker) Run

func (worker *Worker) Run(stop <-chan struct{})

Run the worker

func (*Worker) SetLockRetryDelay

func (worker *Worker) SetLockRetryDelay(lockRetryDelay time.Duration)

SetLockRetryDelay changes the delay between unsuccessful acquire attempts of the lock

Jump to

Keyboard shortcuts

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