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

Method topicProxyGone

server/cluster.go:926–941  ·  view source on GitHub ↗

Topic proxy terminated. Inform remote Master node that the proxy is gone.

(topicName string)

Source from the content-addressed store, hash-verified

924
925// Topic proxy terminated. Inform remote Master node that the proxy is gone.
926func (c *Cluster) topicProxyGone(topicName string) error {
927 if c == nil {
928 // Cluster may be nil due to shutdown.
929 return nil
930 }
931
932 // Find the cluster node which owns the topic, then forward to it.
933 n := c.nodeForTopic(topicName)
934 if n == nil {
935 return errors.New("node for topic not found")
936 }
937
938 req := c.makeClusterReq(ProxyReqLeave, nil, topicName, nil)
939 req.Gone = true
940 return n.proxyToMasterAsync(req)
941}
942
943// Returns snowflake worker id.
944func clusterInit(configString json.RawMessage, self *string) int {

Callers 1

runProxyMethod · 0.80

Calls 3

nodeForTopicMethod · 0.95
makeClusterReqMethod · 0.95
proxyToMasterAsyncMethod · 0.80

Tested by

no test coverage detected