code: func (p *BulkProcessor) Close() error {
  	p.startedMu.Lock()
  	defer p.startedMu.Unlock()
  
  	// Already stopped? Do nothing.
  	if !p.started {
  		return nil
  	}
  
  	// Tell connection checkers to stop
  	if p.stopReconnC != nil {
  		close(p.stopReconnC)
  		p.stopReconnC = nil
  	}
  
  	// Stop flusher (if enabled)
  	if p.flusherStopC != nil {
  		p.flusherStopC <- struct{}{}
  		<-p.flusherStopC
  		close(p.flusherStopC)
  		p.flusherStopC = nil
  	}
  
  	// Stop all workers.
  	close(p.requestsC)
  	p.workerWg.Wait()
  
  	p.started = false
  
  	return nil
  }
docs: // Close stops the bulk processor previously started with Do.
  // If it is already stopped, this is a no-op and nil is returned.
  //
  // By implementing Close, BulkProcessor implements the io.Closer interface.