func (runner *Runner) startWorker(req startReq) error {
	if runner.isDying {
		runner.params.Logger.Infof("ignoring start request for %q when dying", req.id)
		return nil
	}
	info := runner.workers[req.id]
	if info == nil {
		runner.mu.Lock()
		defer runner.mu.Unlock()
		runner.workers[req.id] = &workerInfo{
			start:        req.start,
			restartDelay: runner.params.RestartDelay,
			started:      runner.params.Clock.Now().UTC(),
			done:         make(chan struct{}, 1),
		}
		go runner.runWorker(0, req.id, req.start)
		return nil
	}
	return errors.AlreadyExistsf("worker %q", req.id)
}
// startWorker responds when a worker has been started
// by calling StartWorker.
startWorker responds when a worker has been started
by calling StartWorker.
// startWorker responds when a worker has been started // by calling StartWorker .
func (runner *Runner) startWorker(req startReq) error {
	if runner.isDying {
		runner.params.Logger.Infof("ignoring start request for %q when dying", req.id)
		return nil
	}
	info := runner.workers[req.id]
	if info == nil {
		runner.mu.Lock()
		defer runner.mu.Unlock()
		runner.workers[req.id] = &workerInfo{
			start:        req.start,
			restartDelay: runner.params.RestartDelay,
			started:      runner.params.Clock.Now().UTC(),
			done:         make(chan struct{}, 1),
		}
		go runner.runWorker(0, req.id, req.start)
		return nil
	}
	return errors.AlreadyExistsf("worker %q", req.id)
}
func ( runner * Runner ) startWorker ( req startReq ) error { if runner . isDying { runner . params . Logger . Infof ( " " , req . id ) return nil } info := runner . workers [ req . id ] if info == nil { runner . mu . Lock ( ) defer runner . mu . Unlock ( ) runner . workers [ req . id ] = & workerInfo { start : req . start , restartDelay : runner . params . RestartDelay , started : runner . params . Clock . Now ( ) . UTC ( ) , done : make ( chan struct { } , 1 ) , } go runner . runWorker ( 0 , req . id , req . start ) return nil } return errors . AlreadyExistsf ( " " , req . id ) }
startWorker responds when a worker has been started
by calling StartWorker.
startWorker responds when a worker has been started by calling StartWorker .