MCPcopy
hub / github.com/grpc/grpc-go / WithMaxCallAttempts

Function WithMaxCallAttempts

dialoptions.go:799–806  ·  view source on GitHub ↗

WithMaxCallAttempts returns a DialOption that configures the maximum number of attempts per call (including retries and hedging) using the channel. Service owners may specify a higher value for these parameters, but higher values will be treated as equal to the maximum value by the client implementa

(n int)

Source from the content-addressed store, hash-verified

797//
798// A value of 5 will be used if this dial option is not set or n < 2.
799func WithMaxCallAttempts(n int) DialOption {
800 return newFuncDialOption(func(o *dialOptions) {
801 if n < 2 {
802 n = defaultMaxCallAttempts
803 }
804 o.maxCallAttempts = n
805 })
806}
807
808func withBufferPool(bufferPool mem.BufferPool) DialOption {
809 return newFuncDialOption(func(o *dialOptions) {

Callers 1

TestMaxCallAttemptsMethod · 0.92

Calls 1

newFuncDialOptionFunction · 0.85

Tested by 1

TestMaxCallAttemptsMethod · 0.74