code: func (b *BulkIndexer) Stop() {
  	ch := make(chan struct{}, 1)
  	b.shutdownChan <- ch
  	select {
  	case <-ch:
  		// done
  	case <-time.After(time.Second * time.Duration(MAX_SHUTDOWN_SECS)):
  		// timeout!
  	}
  }
docs: // Stop stops the bulk indexer, blocking the caller until it is complete.