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

Function waitForCoordinatorIndefinitely

findcoordinator_test.go:65–73  ·  view source on GitHub ↗

WaitForCoordinatorIndefinitely is a blocking call till a coordinator is found.

(ctx context.Context, c *Client, req *FindCoordinatorRequest)

Source from the content-addressed store, hash-verified

63
64// WaitForCoordinatorIndefinitely is a blocking call till a coordinator is found.
65func waitForCoordinatorIndefinitely(ctx context.Context, c *Client, req *FindCoordinatorRequest) (*FindCoordinatorResponse, error) {
66 resp, err := c.FindCoordinator(ctx, req)
67
68 for shouldRetryfindingCoordinator(resp, err) && ctx.Err() == nil {
69 time.Sleep(1 * time.Second)
70 resp, err = c.FindCoordinator(ctx, req)
71 }
72 return resp, err
73}
74
75// Should retry looking for coordinator
76// Returns true when the test Kafka broker is still setting up.

Callers 8

TestClientJoinGroupFunction · 0.85
TestClientInitProducerIdFunction · 0.85
TestClientLeaveGroupFunction · 0.85
TestClientSyncGroupFunction · 0.85

Calls 3

FindCoordinatorMethod · 0.80
ErrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…