code: func (b *basicBatcher) Dispose() {
  	for {
  		if b.lock.TryLock() {
  			// We've got a lock
  			if b.disposed {
  				b.lock.Unlock()
  				return
  			}
  
  			b.disposed = true
  			b.items = nil
  			b.drainBatchChan()
  			close(b.batchChan)
  			b.lock.Unlock()
  		} else {
  			// Two cases here:
  			// 1) Something is blocked and holding onto the lock
  			// 2) Something temporarily has a lock
  			// For case 1, we have to clear at least some space so the blocked
  			// Put/Flush can release the lock. For case 2, nothing bad
  			// will happen here
  			b.drainBatchChan()
  		}
  
  	}
  }
docs: // Dispose will dispose of the batcher. Any calls to Put or Flush
  // will return ErrDisposed, calls to Get will return an error iff
  // there are no more ready batches. Any items not flushed and retrieved
  // by a Get may or may not be retrievable after calling this.