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

Method Close

mockbroker.go:148–159  ·  mockbroker.go::MockBroker.Close

Close terminates the broker blocking until it stops internal goroutines and releases all resources.

()

Source from the content-addressed store, hash-verified

146// Close terminates the broker blocking until it stops internal goroutines and
147// releases all resources.
148func (b *MockBroker) Close() {
149 close(b.expectations)
150 if len(b.expectations) > 0 {
151 buf := bytes.NewBufferString(fmt.Sprintf("mockbroker/%d: not all expectations were satisfied! Still waiting on:\n", b.BrokerID()))
152 for e := range b.expectations {
153 _, _ = buf.WriteString(spew.Sdump(e))
154 }
155 b.t.Error(buf.String())
156 }
157 close(b.closing)
158 <-b.stopper
159}
160
161// setHandler sets the specified function as the request handler. Whenever
162// a mock broker reads a request from the wire it passes the request to the

Calls 3

BrokerIDMethod · 0.95
ErrorMethod · 0.65
StringMethod · 0.45