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

Function WithIdleTimeout

dialoptions.go:785–789  ·  view source on GitHub ↗

WithIdleTimeout returns a DialOption that configures an idle timeout for the channel. If the channel is idle for the configured timeout, i.e there are no ongoing RPCs and no new RPCs are initiated, the channel will enter idle mode and as a result the name resolver and load balancer will be shut down

(d time.Duration)

Source from the content-addressed store, hash-verified

783// Notice: This API is EXPERIMENTAL and may be changed or removed in a
784// later release.
785func WithIdleTimeout(d time.Duration) DialOption {
786 return newFuncDialOption(func(o *dialOptions) {
787 o.idleTimeout = d
788 })
789}
790
791// WithMaxCallAttempts returns a DialOption that configures the maximum number
792// of attempts per call (including retries and hedging) using the channel.

Calls 1

newFuncDialOptionFunction · 0.85