worker/simple.go
func (w Simple) Perform(job Job) error {
	w.Logger.Debugf("Performing job %s", job)
	if job.Handler == "" {
		err := fmt.Errorf("no handler name given for %s", job)
		w.Logger.Error(err)
		return err
	}
	w.moot.Lock()
	defer w.moot.Unlock()
	if h, ok := w.handlers[job.Handler]; ok {
		go func() {
			err := safe.RunE(func() error {
				return h(job.Args)
			})

			if err != nil {
				w.Logger.Error(err)
			}
			w.Logger.Debugf("Completed job %s", job)
		}()
		return nil
	}
	err := fmt.Errorf("no handler mapped for name %s", job.Handler)
	w.Logger.Error(err)
	return err
}
func (w Simple) Perform(job Job) error {
	w.Logger.Debugf("Performing job %s", job)
	if job.Handler == "" {
		err := fmt.Errorf("no handler name given for %s", job)
		w.Logger.Error(err)
		return err
	}
	w.moot.Lock()
	defer w.moot.Unlock()
	if h, ok := w.handlers[job.Handler]; ok {
		go func() {
			err := safe.RunE(func() error {
				return h(job.Args)
			})

			if err != nil {
				w.Logger.Error(err)
			}
			w.Logger.Debugf("Completed job %s", job)
		}()
		return nil
	}
	err := fmt.Errorf("no handler mapped for name %s", job.Handler)
	w.Logger.Error(err)
	return err
}
func ( w Simple ) Perform ( job Job ) error { w . Logger . Debugf ( " " , job ) if job . Handler == " " { err := fmt . Errorf ( " " , job ) w . Logger . Error ( err ) return err } w . moot . Lock ( ) defer w . moot . Unlock ( ) if h , ok := w . handlers [ job . Handler ] ; ok { go func ( ) { err := safe . RunE ( func ( ) error { return h ( job . Args ) } ) if err != nil { w . Logger . Error ( err ) } w . Logger . Debugf ( " " , job ) } ( ) return nil } err := fmt . Errorf ( " " , job . Handler ) w . Logger . Error ( err ) return err }
// Perform a job as soon as possibly using a goroutine.
Perform a job as soon as possibly using a goroutine .