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

Method sendAndReceive

broker.go:1173–1196  ·  view source on GitHub ↗
(req protocolBody, res protocolBody)

Source from the content-addressed store, hash-verified

1171}
1172
1173func (b *Broker) sendAndReceive(req protocolBody, res protocolBody) error {
1174 b.lock.Lock()
1175 defer b.lock.Unlock()
1176
1177 promise, err := b.send(req, res)
1178 if err != nil {
1179 b.maybeCloseLocked(err)
1180 return err
1181 }
1182
1183 if promise == nil {
1184 return nil
1185 }
1186
1187 err = handleResponsePromise(req, res, promise, b.metricRegistry)
1188 if err != nil {
1189 b.maybeCloseLocked(err)
1190 return err
1191 }
1192 if res != nil {
1193 b.handleThrottledResponse(res)
1194 }
1195 return nil
1196}
1197
1198// negotiateApiVersion clamps pb's version to the broker's advertised maximum
1199// for pb's API (treating pb's current version as the client max). When the

Callers 15

GetMetadataMethod · 0.95
DescribeClusterMethod · 0.95
GetConsumerMetadataMethod · 0.95
FindCoordinatorMethod · 0.95
GetAvailableOffsetsMethod · 0.95
ProduceMethod · 0.95
FetchMethod · 0.95
CommitOffsetMethod · 0.95
FetchOffsetMethod · 0.95
JoinGroupMethod · 0.95
SyncGroupMethod · 0.95
LeaveGroupMethod · 0.95

Calls 4

sendMethod · 0.95
maybeCloseLockedMethod · 0.95
handleResponsePromiseFunction · 0.85

Tested by

no test coverage detected