MCPcopy
hub / github.com/nats-io/nats.go / ReconnectWait

Function ReconnectWait

nats.go:1143–1148  ·  view source on GitHub ↗

ReconnectWait is an Option to set the wait time between reconnect attempts. Defaults to 2s.

(t time.Duration)

Source from the content-addressed store, hash-verified

1141// ReconnectWait is an Option to set the wait time between reconnect attempts.
1142// Defaults to 2s.
1143func ReconnectWait(t time.Duration) Option {
1144 return func(o *Options) error {
1145 o.ReconnectWait = t
1146 return nil
1147 }
1148}
1149
1150// MaxReconnects is an Option to set the maximum number of reconnect attempts.
1151// If negative, it will never stop trying to reconnect.

Callers 1

Calls

no outgoing calls

Tested by 1