workers

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = module.Module{
	{Constructor: NewWorkersGroup},
	{Constructor: NewWorkers},
}

Functions

func NewWorkersGroup

func NewWorkersGroup(wrks []*worker.Worker) *worker.Group

NewWorkersGroup returns workers group with injected workers

Types

type Params

type Params struct {
	dig.In

	Config *viper.Viper
	Logger *zap.Logger
	Redis  *redis.Client `optional:"true"`
	Jobs   map[string]worker.Job
}

Params is dependencies for create workers slice

type Result

type Result struct {
	dig.Out
	Workers []*worker.Worker
}

Result returns wrapped workers group for di

func NewWorkers

func NewWorkers(p Params) (Result, error)

NewWorkers returns wrapped workers slice builded by config settings

Jump to

Keyboard shortcuts

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