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

Method call

server/cluster.go:309–329  ·  view source on GitHub ↗
(proc string, req, resp any)

Source from the content-addressed store, hash-verified

307}
308
309func (n *ClusterNode) call(proc string, req, resp any) error {
310 if !n.connected {
311 return errors.New("cluster: node '" + n.name + "' not connected")
312 }
313
314 if err := n.endpoint.Call(proc, req, resp); err != nil {
315 logs.Warn.Println("cluster: call failed", n.name, err)
316
317 n.lock.Lock()
318 if n.connected {
319 n.endpoint.Close()
320 n.connected = false
321 statsInc("LiveClusterNodes", -1)
322 go n.reconnect()
323 }
324 n.lock.Unlock()
325 return err
326 }
327
328 return nil
329}
330
331func (n *ClusterNode) handleRpcResponse(call *rpc.Call) {
332 if call.Error != nil {

Callers 5

reconnectMethod · 0.95
proxyToMasterMethod · 0.95
routeMethod · 0.95
sendHealthChecksMethod · 0.80
routeUserReqMethod · 0.80

Calls 6

reconnectMethod · 0.95
statsIncFunction · 0.85
PrintlnMethod · 0.80
LockMethod · 0.80
UnlockMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected