MCPcopy Create free account
hub / github.com/Cyinx/einx / RpcCall

Method RpcCall

module/worker_pool.go:87–98  ·  view source on GitHub ↗
(name string, args ...interface{})

Source from the content-addressed store, hash-verified

85}
86
87func (this *ModuleWorkerPool) RpcCall(name string, args ...interface{}) {
88 var hashkey uint32 = 0
89 length := len(name)
90 if length > 0 {
91 hashkey += uint32(name[0])
92 hashkey += uint32(name[length-1])
93 hashkey += uint32(name[(length-1)/2])
94 hashkey += uint32(length)
95 }
96 m := this.modules[hashkey%this.size] //route the rpc to worker by a simple hash key
97 m.RpcCall(name, args...)
98}
99
100func (this *ModuleWorkerPool) Balancer() Module {
101 idx := this.balance_id % this.size

Callers

nothing calls this directly

Calls 1

RpcCallMethod · 0.65

Tested by

no test coverage detected