HasClientSubscribed - True if a client subscribed to this server with the same topic
(arg *SubscribeArg)
| 78 | |
| 79 | // HasClientSubscribed - True if a client subscribed to this server with the same topic |
| 80 | func (server *Server) HasClientSubscribed(arg *SubscribeArg) bool { |
| 81 | if topicSubscribers, ok := server.subscribers[arg.Topic]; ok { |
| 82 | for _, topicSubscriber := range topicSubscribers { |
| 83 | if *topicSubscriber == *arg { |
| 84 | return true |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | return false |
| 89 | } |
| 90 | |
| 91 | // Start - starts a service for remote clients to subscribe to events |
| 92 | func (server *Server) Start() error { |