leizongmin / huobiapi

火币网API Go客户端
http://leizm.com
MIT License
60 stars 39 forks source link

concurrent map read and map write #7

Closed skanger closed 5 years ago

skanger commented 5 years ago

Market的Subscribe、Reconnect和handleMessageLoop方法都会访问listeners这个map 而subscribe和handleMessageLoop是有可能并发访问这个map的 Reconnect也会和handleMessageLoop产生竞争。

可以改为加锁的map或者改用sync.Map

leizongmin commented 5 years ago

已经合并啦