worker

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "narada"

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Name             string
	Handler          func()
	Period           time.Duration
	Cron             string
	Exclusive        bool
	ExclusiveTimeout time.Duration
	Immediately      bool
}

type Options

type Options struct {
	fx.In

	Logger *logrus.Logger
	Config *viper.Viper
	Locker lock.Locker
	LC     fx.Lifecycle
}

type Workers

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

func New

func New(opts Options) (*Workers, error)

func (*Workers) Add

func (w *Workers) Add(jobs ...Job)

Jump to

Keyboard shortcuts

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