NewAsyncProducerFromClient creates a new Producer using the given client. It is still necessary to call Close() on the underlying client when shutting down this producer.
(client Client)
| 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. |
| 292 | func NewAsyncProducerFromClient(client Client) (AsyncProducer, error) { |
| 293 | // For clients passed in by the client, ensure we don't |
| 294 | // call Close() on it. |
| 295 | cli := &nopCloserClient{client} |
| 296 | return newAsyncProducer(cli) |
| 297 | } |
| 298 | |
| 299 | func newAsyncProducer(client Client) (AsyncProducer, error) { |
| 300 | // Check that we are not dealing with a closed Client before processing any other arguments |