Help us shape the future of Go! Take the 2026 Go Developer Survey

jobs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Periodic

type Periodic interface {
	// Do begins the periodic job. It starts the first execution of the job, and then is
	// responsible for executing it every Frequency() thereafter
	Do() error
	Frequency() time.Duration
	Name() string
	FirstRun() bool
}

Periodic is an interface for managing periodic job invocation

type PeriodicCanceller

type PeriodicCanceller func()

PeriodicCanceller will cancel one or more Periodic jobs

func DoPeriodic

func DoPeriodic(pSlice []Periodic) PeriodicCanceller

DoPeriodic calls p.Do() once, and then again every p.Frequency() on each element p in pSlice. For each p in pSlice, a new goroutine is started, and the returned channel can be closed to stop all of the goroutines.

Jump to

Keyboard shortcuts

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