renamed to subscribeHandler
This commit is contained in:
@@ -35,8 +35,8 @@ type RecConn struct {
|
|||||||
HandshakeTimeout time.Duration
|
HandshakeTimeout time.Duration
|
||||||
// NonVerbose suppress connecting/reconnecting messages.
|
// NonVerbose suppress connecting/reconnecting messages.
|
||||||
NonVerbose bool
|
NonVerbose bool
|
||||||
// ConnectHandler fires after the connection successfully establish.
|
// SubscribeHandler fires after the connection successfully establish.
|
||||||
ConnectHandler func(rc *RecConn) error
|
SubscribeHandler func(rc *RecConn) error
|
||||||
|
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
url string
|
url string
|
||||||
@@ -217,11 +217,11 @@ func (rc *RecConn) connect() {
|
|||||||
log.Printf("Dial: connection was successfully established with %s\n", rc.url)
|
log.Printf("Dial: connection was successfully established with %s\n", rc.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
if rc.ConnectHandler == nil {
|
if rc.SubscribeHandler == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := rc.ConnectHandler(rc); err != nil {
|
if err := rc.SubscribeHandler(rc); err != nil {
|
||||||
log.Fatalf("Dial: connect handler failed with %s", err.Error())
|
log.Fatalf("Dial: connect handler failed with %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user