MCPcopy
hub / github.com/tinode/chat / isRemoteTopic

Method isRemoteTopic

server/cluster.go:799–805  ·  view source on GitHub ↗

isRemoteTopic checks if the given topic is handled by this node or a remote node.

(topic string)

Source from the content-addressed store, hash-verified

797
798// isRemoteTopic checks if the given topic is handled by this node or a remote node.
799func (c *Cluster) isRemoteTopic(topic string) bool {
800 if c == nil {
801 // Cluster not initialized, all topics are local
802 return false
803 }
804 return c.ring.Get(topic) != c.thisNodeName
805}
806
807// genLocalTopicName is just like genTopicName(), but the generated name belongs to the current cluster node.
808func (c *Cluster) genLocalTopicName() string {

Callers 7

sendPushFunction · 0.80
runMethod · 0.80
usersUpdateUnreadFunction · 0.80
usersRegisterUserFunction · 0.80
usersRemoveUserFunction · 0.80
usersRegisterTopicFunction · 0.80
UserCacheUpdateMethod · 0.80

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected