From 20453c885d4c744f0e870cc7bdc6e1d84ec37469 Mon Sep 17 00:00:00 2001 From: magodo Date: Wed, 15 May 2019 14:39:06 +0800 Subject: [PATCH] Revert "Use `Drain()` to unsuscribe or close connection" This reverts commit 4d5859307ddbcc3c6af907ba0d0fac395b466836. --- nats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nats.go b/nats.go index 5acba41..b4da34c 100644 --- a/nats.go +++ b/nats.go @@ -56,7 +56,7 @@ func (n *subscriber) Topic() string { } func (n *subscriber) Unsubscribe() error { - return n.s.Drain() + return n.s.Unsubscribe() } func (n *nbroker) Address() string { @@ -121,7 +121,7 @@ func (n *nbroker) Connect() error { func (n *nbroker) Disconnect() error { n.RLock() - n.conn.Drain() + n.conn.Close() n.RUnlock() return nil }