code: func (b *batchProducer) Stop() error {
  	b.runningMu.Lock()
  	defer b.runningMu.Unlock()
  
  	if !b.running {
  		return ErrAlreadyStopped
  	}
  
  	// request the main goroutine to stop
  	b.stop <- true
  
  	// block until the main goroutine returns a value indicating that it has stopped
  	<-b.stop
  
  	b.running = false
  
  	return nil
  }
docs: // from/for interface Producer