1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

DisconnectErrHandler should be used now

This commit is contained in:
Dwayne Bradley 2020-01-29 16:31:07 -05:00
parent cc952801a3
commit 1999d0cadd

View File

@ -9,8 +9,8 @@ Because reconnect is primarily under the covers many libraries provide an event
// and the state of the connection may have changed when // and the state of the connection may have changed when
// the callback is invoked. // the callback is invoked.
nc, err := nats.Connect("demo.nats.io", nc, err := nats.Connect("demo.nats.io",
nats.DisconnectHandler(func(nc *nats.Conn) { nats.DisconnectErrHandler(func(nc *nats.Conn) {
// handle disconnect event // handle disconnect error event
}), }),
nats.ReconnectHandler(func(nc *nats.Conn) { nats.ReconnectHandler(func(nc *nats.Conn) {
// handle reconnect event // handle reconnect event