code: func New(maxTime time.Duration, maxItems, maxBytes, queueLen uint, calculate CalculateBytes) (Batcher, error) {
  	if maxBytes > 0 && calculate == nil {
  		return nil, errors.New("batcher: must provide CalculateBytes function")
  	}
  
  	return &basicBatcher{
  		maxTime:        maxTime,
  		maxItems:       maxItems,
  		maxBytes:       maxBytes,
  		calculateBytes: calculate,
  		items:          make([]interface{}, 0, maxItems),
  		batchChan:      make(chan []interface{}, queueLen),
  		lock:           newMutex(),
  	}, nil
  }
docs: // New creates a new Batcher using the provided arguments.
  // Batch readiness can be determined in three ways:
  //   - Maximum number of bytes per batch
  //   - Maximum number of items per batch
  //   - Maximum amount of time waiting for a batch
  // Values of zero for one of these fields indicate they should not be
  // taken into account when evaluating the readiness of a batch.
  // This provides an ordering guarantee for any given thread such that if a
  // thread places two items in the batcher, Get will guarantee the first
  // item is returned before the second, whether before the second in the same
  // batch, or in an earlier batch.