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)
| 797 | // |
| 798 | // A value of 5 will be used if this dial option is not set or n < 2. |
| 799 | func 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 | |
| 808 | func withBufferPool(bufferPool mem.BufferPool) DialOption { |
| 809 | return newFuncDialOption(func(o *dialOptions) { |