MCPcopy
hub / github.com/IBM/sarama / shutdown

Method shutdown

async_producer.go:1635–1655  ·  view source on GitHub ↗

utility functions

()

Source from the content-addressed store, hash-verified

1633// utility functions
1634
1635func (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
1657func (p *asyncProducer) bumpIdempotentProducerEpoch() {
1658 _, epoch := p.txnmgr.getProducerID()

Callers

nothing calls this directly

Calls 5

closeMethod · 0.80
UnregisterAllMethod · 0.80
PrintlnMethod · 0.65
CloseMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected