Server allows clients to subscribe/unsubscribe for messages, publishing messages with or without events, and manages internal state.
| 88 | // Server allows clients to subscribe/unsubscribe for messages, publishing |
| 89 | // messages with or without events, and manages internal state. |
| 90 | type Server struct { |
| 91 | service.BaseService |
| 92 | |
| 93 | cmds chan cmd |
| 94 | cmdsCap int |
| 95 | |
| 96 | // check if we have subscription before |
| 97 | // subscribing or unsubscribing |
| 98 | mtx tmsync.RWMutex |
| 99 | subscriptions map[string]map[string]struct{} // subscriber -> query (string) -> empty struct |
| 100 | } |
| 101 | |
| 102 | // Option sets a parameter for the server. |
| 103 | type Option func(*Server) |
nothing calls this directly
no outgoing calls
no test coverage detected