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

Function safeAsyncClose

utils.go:53–61  ·  view source on GitHub ↗
(b *Broker)

Source from the content-addressed store, hash-verified

51}
52
53func safeAsyncClose(b *Broker) {
54 go withRecover(func() {
55 if connected, _ := b.Connected(); connected {
56 if err := b.Close(); err != nil {
57 Logger.Println("Error closing broker", b.ID(), ":", err)
58 }
59 }
60 })
61}
62
63// Encoder is a simple interface for any type that can be encoded as an array of bytes
64// in order to be sent as the key or value of a Kafka message. Length() is provided as an

Callers 6

CloseMethod · 0.85
RefreshBrokersMethod · 0.85
checkBrokersHealthMethod · 0.85
updateBrokerMethod · 0.85
registerBrokerMethod · 0.85

Calls 5

withRecoverFunction · 0.85
ConnectedMethod · 0.80
IDMethod · 0.80
CloseMethod · 0.65
PrintlnMethod · 0.65

Tested by

no test coverage detected