func (p *StringBatchProcessor) prime() {
	defer p.mu.Unlock()
	p.mu.Lock()
	p.primedJobs = make([]func(<-chan struct{}) (string, error), len(p.jobs))
	for i := 0; i <= len(p.primedJobs)-1; i++ {
		job := p.jobs[i]
		primedJob := func(stop <-chan struct{}) (string, error) {
			result, err := job()
			if err != nil {
				return "", err
			} else {
				return result, nil
			}
		}
		p.primedJobs[i] = primedJob
	}
}
// Prime wraps the runtime jobs in a function which provides a channel that can be used to track the results.
Prime wraps the runtime jobs in a function which provides a channel that can be used to track the results.
// Prime wraps the runtime jobs in a function which provides a channel that can be used to track the results .
func (p *StringBatchProcessor) prime() {
	defer p.mu.Unlock()
	p.mu.Lock()
	p.primedJobs = make([]func(<-chan struct{}) (string, error), len(p.jobs))
	for i := 0; i <= len(p.primedJobs)-1; i++ {
		job := p.jobs[i]
		primedJob := func(stop <-chan struct{}) (string, error) {
			result, err := job()
			if err != nil {
				return "", err
			} else {
				return result, nil
			}
		}
		p.primedJobs[i] = primedJob
	}
}
func ( p * StringBatchProcessor ) prime ( ) { defer p . mu . Unlock ( ) p . mu . Lock ( ) p . primedJobs = make ( [ ] func ( <- chan struct { } ) ( string , error ) , len ( p . jobs ) ) for i := 0 ; i <= len ( p . primedJobs ) - 1 ; i ++ { job := p . jobs [ i ] primedJob := func ( stop <- chan struct { } ) ( string , error ) { result , err := job ( ) if err != nil { return " " , err } else { return result , nil } } p . primedJobs [ i ] = primedJob } }
Prime wraps the runtime jobs in a function which provides a channel that can be used to track the results.
Prime wraps the runtime jobs in a function which provides a channel that can be used to track the results .