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

Method SetReconnectHandler

nats.go:1703–1710  ·  view source on GitHub ↗

SetReconnectHandler will set the reconnect event handler.

(rcb ConnHandler)

Source from the content-addressed store, hash-verified

1701
1702// SetReconnectHandler will set the reconnect event handler.
1703func (nc *Conn) SetReconnectHandler(rcb ConnHandler) {
1704 if nc == nil {
1705 return
1706 }
1707 nc.mu.Lock()
1708 defer nc.mu.Unlock()
1709 nc.Opts.ReconnectedCB = rcb
1710}
1711
1712// ReconnectHandler will return the reconnect event handler.
1713func (nc *Conn) ReconnectHandler() ConnHandler {

Callers 1

TestOptionsFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestOptionsFunction · 0.64