增加判断

This commit is contained in:
langhuihui
2021-06-15 22:58:43 +08:00
parent 6090d2e738
commit 9ee69d4cf5

View File

@@ -30,9 +30,13 @@ type Subscriber struct {
}
func (s *Subscriber) close() {
if s.Stream != nil {
s.UnSubscribe(s)
}
if s.cancel != nil {
s.cancel()
}
}
// Close 关闭订阅者
func (s *Subscriber) Close() {