NewAsyncProducer creates a new AsyncProducer using the given broker addresses and configuration.
(addrs []string, conf *Config)
| 280 | |
| 281 | // NewAsyncProducer creates a new AsyncProducer using the given broker addresses and configuration. |
| 282 | func NewAsyncProducer(addrs []string, conf *Config) (AsyncProducer, error) { |
| 283 | client, err := NewClient(addrs, conf) |
| 284 | if err != nil { |
| 285 | return nil, err |
| 286 | } |
| 287 | return newAsyncProducer(client) |
| 288 | } |
| 289 | |
| 290 | // NewAsyncProducerFromClient creates a new Producer using the given client. It is still |
| 291 | // necessary to call Close() on the underlying client when shutting down this producer. |