zhou.xiaoning пре 2 година
родитељ
комит
fcb119415a
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      publish/publish.go

+ 6 - 0
publish/publish.go

@@ -47,9 +47,13 @@ func (p *Publisher) Unsubscribe(topic Topic, ch chan interface{}) {
 }
 
 func (p *Publisher) Publish(topic Topic, data interface{}) {
+	fmt.Printf("Publish++++++++++++ 1 \n")
+
 	p.mu.RLock()
 	defer p.mu.RUnlock()
 
+	fmt.Printf("Publish++++++++++++ 2 \n")
+
 	if subs, ok := p.subscribers[topic]; ok {
 		if topic == Topic_Trading {
 			fmt.Printf("Publish-Topic_Trading 获取sub, topic: %v sub: %v \n", topic, subs)
@@ -64,4 +68,6 @@ func (p *Publisher) Publish(topic Topic, data interface{}) {
 	} else {
 		fmt.Printf("Publish 获取订阅目标失败, topic: %v \n", topic)
 	}
+
+	fmt.Printf("Publish++++++++++++ 3 \n")
 }