code: func (b *basicBatcher) Put(item interface{}) error {
  	b.lock.Lock()
  	if b.disposed {
  		b.lock.Unlock()
  		return ErrDisposed
  	}
  
  	b.items = append(b.items, item)
  	if b.calculateBytes != nil {
  		b.availableBytes += b.calculateBytes(item)
  	}
  	if b.ready() {
  		// To guarantee ordering this MUST be in the lock, otherwise multiple
  		// flush calls could be blocked at the same time, in which case
  		// there's no guarantee each batch is placed into the channel in
  		// the proper order
  		b.flush()
  	}
  
  	b.lock.Unlock()
  	return nil
  }
docs: // Put adds items to the batcher.