MCPcopy Create free account
hub / github.com/asaskevich/EventBus / HasClientSubscribed

Method HasClientSubscribed

server.go:80–89  ·  view source on GitHub ↗

HasClientSubscribed - True if a client subscribed to this server with the same topic

(arg *SubscribeArg)

Source from the content-addressed store, hash-verified

78
79// HasClientSubscribed - True if a client subscribed to this server with the same topic
80func (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
92func (server *Server) Start() error {

Callers 1

RegisterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected