func NewRunner(p RunnerParams) *Runner {
	if p.IsFatal == nil {
		p.IsFatal = func(error) bool {
			return true
		}
	}
	if p.MoreImportant == nil {
		p.MoreImportant = func(err0, err1 error) bool {
			return true
		}
	}
	if p.RestartDelay == 0 {
		p.RestartDelay = DefaultRestartDelay
	}
	if p.Clock == nil {
		p.Clock = clock.WallClock
	}
	if p.Logger == nil {
		p.Logger = noopLogger{}
	}

	runner := &Runner{
		startc:   make(chan startReq),
		stopc:    make(chan string),
		donec:    make(chan doneInfo),
		startedc: make(chan startInfo),
		params:   p,
		workers:  make(map[string]*workerInfo),
	}
	runner.workersChangedCond.L = &runner.mu
	runner.tomb.Go(runner.run)
	return runner
}
// NewRunner creates a new Runner.  When a worker finishes, if its error
// is deemed fatal (determined by calling isFatal), all the other workers
// will be stopped and the runner itself will finish.  Of all the fatal errors
// returned by the stopped workers, only the most important one,
// determined by calling moreImportant, will be returned from
// Runner.Wait. Non-fatal errors will not be returned.
//
// The function isFatal(err) returns whether err is a fatal error.  The
// function moreImportant(err0, err1) returns whether err0 is considered
// more important than err1.
NewRunner creates a new Runner.  When a worker finishes, if its error
is deemed fatal (determined by calling isFatal), all the other workers
will be stopped and the runner itself will finish.  Of all the fatal errors
returned by the stopped workers, only the most important one,
determined by calling moreImportant, will be returned from
Runner.Wait. Non-fatal errors will not be returned.

The function isFatal(err) returns whether err is a fatal error.  The
function moreImportant(err0, err1) returns whether err0 is considered
more important than err1.
// NewRunner creates a new Runner . When a worker finishes if its error // is deemed fatal ( determined by calling isFatal ) all the other workers // will be stopped and the runner itself will finish . Of all the fatal errors // returned by the stopped workers only the most important one // determined by calling moreImportant will be returned from // Runner . Wait . Non - fatal errors will not be returned . // // The function isFatal ( err ) returns whether err is a fatal error . The // function moreImportant ( err0 err1 ) returns whether err0 is considered // more important than err1 .
func NewRunner(p RunnerParams) *Runner {
	if p.IsFatal == nil {
		p.IsFatal = func(error) bool {
			return true
		}
	}
	if p.MoreImportant == nil {
		p.MoreImportant = func(err0, err1 error) bool {
			return true
		}
	}
	if p.RestartDelay == 0 {
		p.RestartDelay = DefaultRestartDelay
	}
	if p.Clock == nil {
		p.Clock = clock.WallClock
	}
	if p.Logger == nil {
		p.Logger = noopLogger{}
	}
	runner := &Runner{
		startc:   make(chan startReq),
		stopc:    make(chan string),
		donec:    make(chan doneInfo),
		startedc: make(chan startInfo),
		params:   p,
		workers:  make(map[string]*workerInfo),
	}
	runner.workersChangedCond.L = &runner.mu
	runner.tomb.Go(runner.run)
	return runner
}
func NewRunner ( p RunnerParams ) * Runner { if p . IsFatal == nil { p . IsFatal = func ( error ) bool { return true } } if p . MoreImportant == nil { p . MoreImportant = func ( err0 , err1 error ) bool { return true } } if p . RestartDelay == 0 { p . RestartDelay = DefaultRestartDelay } if p . Clock == nil { p . Clock = clock . WallClock } if p . Logger == nil { p . Logger = noopLogger { } } runner := & Runner { startc : make ( chan startReq ) , stopc : make ( chan string ) , donec : make ( chan doneInfo ) , startedc : make ( chan startInfo ) , params : p , workers : make ( map [ string ] * workerInfo ) , } runner . workersChangedCond . L = & runner . mu runner . tomb . Go ( runner . run ) return runner }
NewRunner creates a new Runner.
NewRunner creates a new Runner .