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

Function LameDuckModeHandler

nats.go:1535–1540  ·  view source on GitHub ↗

LameDuckModeHandler sets the callback to invoke when the server notifies the connection that it entered lame duck mode, that is, going to gradually disconnect all its connections before shutting down. This is often used in deployments when upgrading NATS Servers.

(cb ConnHandler)

Source from the content-addressed store, hash-verified

1533// gradually disconnect all its connections before shutting down. This is
1534// often used in deployments when upgrading NATS Servers.
1535func LameDuckModeHandler(cb ConnHandler) Option {
1536 return func(o *Options) error {
1537 o.LameDuckModeHandler = cb
1538 return nil
1539 }
1540}
1541
1542// RetryOnFailedConnect sets the connection in reconnecting state right away
1543// if it can't connect to a server in the initial set.

Callers 1

TestLameDuckModeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestLameDuckModeFunction · 0.68