utility functions
()
| 1633 | // utility functions |
| 1634 | |
| 1635 | func (p *asyncProducer) shutdown() { |
| 1636 | Logger.Println("Producer shutting down.") |
| 1637 | p.inFlight.Add(1) |
| 1638 | p.input <- &ProducerMessage{flags: shutdown} |
| 1639 | |
| 1640 | p.inFlight.Wait() |
| 1641 | |
| 1642 | err := p.client.Close() |
| 1643 | if err != nil { |
| 1644 | Logger.Println("producer/shutdown failed to close the embedded client:", err) |
| 1645 | } |
| 1646 | |
| 1647 | p.muter.close() |
| 1648 | |
| 1649 | close(p.input) |
| 1650 | close(p.retries) |
| 1651 | close(p.errors) |
| 1652 | close(p.successes) |
| 1653 | |
| 1654 | p.metricsRegistry.UnregisterAll() |
| 1655 | } |
| 1656 | |
| 1657 | func (p *asyncProducer) bumpIdempotentProducerEpoch() { |
| 1658 | _, epoch := p.txnmgr.getProducerID() |
nothing calls this directly
no test coverage detected