(ctx context.Context, addr string,
f func(context.Context, pb.WorkerClient) (interface{}, error))
| 41 | ) |
| 42 | |
| 43 | func invokeNetworkRequest(ctx context.Context, addr string, |
| 44 | f func(context.Context, pb.WorkerClient) (interface{}, error)) (interface{}, error) { |
| 45 | pl, err := conn.GetPools().Get(addr) |
| 46 | if err != nil { |
| 47 | return nil, errors.Wrapf(err, "dispatchTaskOverNetwork: while retrieving connection.") |
| 48 | } |
| 49 | |
| 50 | span := trace.SpanFromContext(ctx) |
| 51 | span.AddEvent("invokeNetworkRequest", trace.WithAttributes( |
| 52 | attribute.String("destination", addr))) |
| 53 | c := pb.NewWorkerClient(pl.Get()) |
| 54 | return f(ctx, c) |
| 55 | } |
| 56 | |
| 57 | const backupRequestGracePeriod = time.Second |
| 58 |
no test coverage detected