WaitForCoordinatorIndefinitely is a blocking call till a coordinator is found.
(ctx context.Context, c *Client, req *FindCoordinatorRequest)
| 63 | |
| 64 | // WaitForCoordinatorIndefinitely is a blocking call till a coordinator is found. |
| 65 | func 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. |
no test coverage detected
searching dependent graphs…