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)
| 1533 | // gradually disconnect all its connections before shutting down. This is |
| 1534 | // often used in deployments when upgrading NATS Servers. |
| 1535 | func 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. |
no outgoing calls