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

Method DialContext

dialer.go:112–122  ·  view source on GitHub ↗

DialContext connects to the address on the named network using the provided context. The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection. When

(ctx context.Context, network string, address string)

Source from the content-addressed store, hash-verified

110// 1 minute, the connect to each single address will be given 15 seconds to
111// complete before trying the next one.
112func (d *Dialer) DialContext(ctx context.Context, network string, address string) (*Conn, error) {
113 return d.connect(
114 ctx,
115 network,
116 address,
117 ConnConfig{
118 ClientID: d.ClientID,
119 TransactionalID: d.TransactionalID,
120 },
121 )
122}
123
124// DialLeader opens a connection to the leader of the partition for a given
125// topic.

Callers 6

DialMethod · 0.95
LookupPartitionMethod · 0.95
LookupPartitionsMethod · 0.95
DialContextFunction · 0.80
NewWriterFunction · 0.80

Calls 1

connectMethod · 0.95

Tested by 1