code: func New(
  	client BatchingKinesisClient,
  	streamName string,
  	config Config,
  ) (Producer, error) {
  	if config.BatchSize < 1 || config.BatchSize > MaxKinesisBatchSize {
  		return nil, errors.New("BatchSize must be between 1 and 500 inclusive")
  	}
  
  	if config.BufferSize < config.BatchSize && config.FlushInterval <= 0 {
  		return nil, errors.New("if BufferSize < BatchSize && FlushInterval <= 0 then the buffer will eventually fill up and Add will block forever")
  	}
  
  	if config.FlushInterval > 0 && config.FlushInterval < 50*time.Millisecond {
  		return nil, errors.New("are you crazy")
  	}
  
  	batchProducer := batchProducer{
  		client:      client,
  		streamName:  streamName,
  		config:      config,
  		logger:      config.Logger,
  		currentStat: new(StatsBatch),
  		records:     make(chan batchRecord, config.BufferSize),
  		start:       make(chan interface{}),
  		stop:        make(chan interface{}),
  	}
  
  	return &batchProducer, nil
  }
docs: // New creates and returns a BatchProducer that will do nothing until its Start method is called.
  // Once it is started, it will flush a batch to Kinesis whenever either
  // the flushInterval occurs (if flushInterval > 0) or the batchSize is reached,
  // whichever happens first.