aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/call.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/grpc/call.go')
-rw-r--r--vendor/google.golang.org/grpc/call.go33
1 files changed, 7 insertions, 26 deletions
diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go
index f73b7d5..180d79d 100644
--- a/vendor/google.golang.org/grpc/call.go
+++ b/vendor/google.golang.org/grpc/call.go
@@ -63,31 +63,12 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
var unaryStreamDesc = &StreamDesc{ServerStreams: false, ClientStreams: false}
func invoke(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error {
- // TODO: implement retries in clientStream and make this simply
- // newClientStream, SendMsg, RecvMsg.
- firstAttempt := true
- for {
- csInt, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...)
- if err != nil {
- return err
- }
- cs := csInt.(*clientStream)
- if err := cs.SendMsg(req); err != nil {
- if !cs.c.failFast && cs.attempt.s.Unprocessed() && firstAttempt {
- // TODO: Add a field to header for grpc-transparent-retry-attempts
- firstAttempt = false
- continue
- }
- return err
- }
- if err := cs.RecvMsg(reply); err != nil {
- if !cs.c.failFast && cs.attempt.s.Unprocessed() && firstAttempt {
- // TODO: Add a field to header for grpc-transparent-retry-attempts
- firstAttempt = false
- continue
- }
- return err
- }
- return nil
+ cs, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...)
+ if err != nil {
+ return err
}
+ if err := cs.SendMsg(req); err != nil {
+ return err
+ }
+ return cs.RecvMsg(reply)
}