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

Method SetDisconnectErrHandler

nats.go:1683–1690  ·  view source on GitHub ↗

SetDisconnectErrHandler will set the disconnect event handler.

(dcb ConnErrHandler)

Source from the content-addressed store, hash-verified

1681
1682// SetDisconnectErrHandler will set the disconnect event handler.
1683func (nc *Conn) SetDisconnectErrHandler(dcb ConnErrHandler) {
1684 if nc == nil {
1685 return
1686 }
1687 nc.mu.Lock()
1688 defer nc.mu.Unlock()
1689 nc.Opts.DisconnectedErrCB = dcb
1690}
1691
1692// DisconnectErrHandler will return the disconnect event handler.
1693func (nc *Conn) DisconnectErrHandler() ConnErrHandler {

Callers 1

TestTimeoutOnNoServersFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestTimeoutOnNoServersFunction · 0.64