// NewWorkers returns wrapped workers slice builded by config settings
NewWorkers returns wrapped workers slice builded by config settings
// NewWorkers returns wrapped workers slice builded by config settings
func NewWorkers(p Params) (Result, error) {
	res := Result{}
	for name, job := range p.Jobs {
		wrk, err := workerByConfig(options{
			Viper:  p.Config,
			Redis:  p.Redis,
			Logger: p.Logger.Sugar(),
			CfgKey: name,
			Job:    job,
		})
		if err != nil {
			return Result{}, err
		}
		res.Workers = append(res.Workers, wrk)
	}
	return res, nil
}
func NewWorkers ( p Params ) ( Result , error ) { res := Result { } for name , job := range p . Jobs { wrk , err := workerByConfig ( options { Viper : p . Config , Redis : p . Redis , Logger : p . Logger . Sugar ( ) , CfgKey : name , Job : job , } ) if err != nil { return Result { } , err } res . Workers = append ( res . Workers , wrk ) } return res , nil }
NewWorkers returns wrapped workers slice builded by config settings
NewWorkers returns wrapped workers slice builded by config settings
// all or nothing