From b93b67a7e237cbf59569dcaacfa84257856ba16e Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 30 十二月 2020 14:19:34 +0800
Subject: [PATCH] 添加DeSub,优化订阅主题消息通道

---
 hbusc.go |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hbusc.go b/hbusc.go
index 6ff4175..def5a75 100644
--- a/hbusc.go
+++ b/hbusc.go
@@ -487,6 +487,17 @@
 	}
 }
 
+//娉ㄩ攢璁㈤槄鐨勪富棰�
+func (h *BHBus) DeSub(topics []string) {
+	if topics != nil {
+		for _,t := range topics {
+			if n := h.sockSub.sock.Desub(t); n != 0 {
+				h.printLog("DeSub topic:", t, " n:", n)
+			}
+		}
+	}
+}
+
 
 //鑾峰彇sub 鎴栬�呴渶瑕乺eply鐨勬秷鎭�
 func (h *BHBus) GetMsg() (subMsg *MsgInfo, replyMsg *MsgInfo, replyKey int) {

--
Gitblit v1.8.0