MCPcopy
hub / github.com/segmentio/kafka-go / RoundTrip

Method RoundTrip

transport.go:178–182  ·  view source on GitHub ↗

RoundTrip sends a request to a kafka cluster and returns the response, or an error if no responses were received. Message types are available in sub-packages of the protocol package. Each kafka API is implemented in a different sub-package. For example, the request and response types for the Fetch

(ctx context.Context, addr net.Addr, req Request)

Source from the content-addressed store, hash-verified

176// features of the kafka protocol, but also provide a more efficient way of
177// managing connections to kafka brokers.
178func (t *Transport) RoundTrip(ctx context.Context, addr net.Addr, req Request) (Response, error) {
179 p := t.grabPool(addr)
180 defer p.unref()
181 return p.roundTrip(ctx, req)
182}
183
184func (t *Transport) dial() func(context.Context, string, string) (net.Conn, error) {
185 if t.Dial != nil {

Callers

nothing calls this directly

Calls 3

grabPoolMethod · 0.95
unrefMethod · 0.45
roundTripMethod · 0.45

Tested by

no test coverage detected