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

Function ReconnectJitter

nats.go:1162–1168  ·  view source on GitHub ↗

ReconnectJitter is an Option to set the upper bound of a random delay added ReconnectWait. Defaults to 100ms and 1s, respectively.

(jitter, jitterForTLS time.Duration)

Source from the content-addressed store, hash-verified

1160// ReconnectJitter is an Option to set the upper bound of a random delay added ReconnectWait.
1161// Defaults to 100ms and 1s, respectively.
1162func ReconnectJitter(jitter, jitterForTLS time.Duration) Option {
1163 return func(o *Options) error {
1164 o.ReconnectJitter = jitter
1165 o.ReconnectJitterTLS = jitterForTLS
1166 return nil
1167 }
1168}
1169
1170// CustomReconnectDelay is an Option to set the CustomReconnectDelayCB option.
1171// See CustomReconnectDelayCB Option for more details.

Callers 1

Calls

no outgoing calls

Tested by 1