Use Drain() to unsuscribe or close connection

This commit is contained in:
magodo 2019-05-15 11:05:29 +08:00 committed by Vasiliy Tolstov
parent 29bf388131
commit e2254ba411

View File

@ -56,7 +56,7 @@ func (n *subscriber) Topic() string {
}
func (n *subscriber) Unsubscribe() error {
return n.s.Unsubscribe()
return n.s.Drain()
}
func (n *nbroker) Address() string {
@ -121,7 +121,7 @@ func (n *nbroker) Connect() error {
func (n *nbroker) Disconnect() error {
n.RLock()
n.conn.Close()
n.conn.Drain()
n.RUnlock()
return nil
}