producer.go
func NewProducer(config ProducerConfig) (p *Producer, err error) {
	config.defaults()

	p = &Producer{
		reqs:         make(chan ProducerRequest, config.MaxConcurrency),
		done:         make(chan struct{}),
		address:      config.Address,
		topic:        config.Topic,
		dialTimeout:  config.DialTimeout,
		readTimeout:  config.ReadTimeout,
		writeTimeout: config.WriteTimeout,
	}

	return
}
func NewProducer(config ProducerConfig) (p *Producer, err error) {
	config.defaults()

	p = &Producer{
		reqs:         make(chan ProducerRequest, config.MaxConcurrency),
		done:         make(chan struct{}),
		address:      config.Address,
		topic:        config.Topic,
		dialTimeout:  config.DialTimeout,
		readTimeout:  config.ReadTimeout,
		writeTimeout: config.WriteTimeout,
	}

	return
}
// NewProducer configures a new producer instance.