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

Function newClient

compress/compress_test.go:496–512  ·  view source on GitHub ↗
(addr net.Addr)

Source from the content-addressed store, hash-verified

494}
495
496func newClient(addr net.Addr) (*kafka.Client, func()) {
497 conns := &ktesting.ConnWaitGroup{
498 DialFunc: (&net.Dialer{}).DialContext,
499 }
500
501 transport := &kafka.Transport{
502 Dial: conns.Dial,
503 }
504
505 client := &kafka.Client{
506 Addr: addr,
507 Timeout: 5 * time.Second,
508 Transport: transport,
509 }
510
511 return client, func() { transport.CloseIdleConnections(); conns.Wait() }
512}

Callers 1

newLocalClientFunction · 0.70

Calls 1

CloseIdleConnectionsMethod · 0.95

Tested by

no test coverage detected