MCPcopy
hub / github.com/davyxu/cellnet / asyncRPC_OnClientEvent

Function asyncRPC_OnClientEvent

tests/rpc_test.go:77–103  ·  view source on GitHub ↗
(ev cellnet.Event)

Source from the content-addressed store, hash-verified

75}
76
77func asyncRPC_OnClientEvent(ev cellnet.Event) {
78
79 switch ev.Message().(type) {
80 case *cellnet.SessionConnected:
81 for i := 0; i < 2; i++ {
82
83 copy := i + 1
84
85 rpc.Call(ev.Session(), &TestEchoACK{
86 Msg: "async",
87 Value: 1234,
88 }, time.Second*5, func(feedback interface{}) {
89
90 switch v := feedback.(type) {
91 case error:
92 asyncRPC_Signal.Log(v)
93 asyncRPC_Signal.FailNow()
94 case *TestEchoACK:
95 log.Debugln("client sync recv:", v.Msg)
96 asyncRPC_Signal.Done(copy)
97 }
98
99 })
100
101 }
102 }
103}
104
105func typeRPC_OnClientEvent(ev cellnet.Event) {
106

Callers

nothing calls this directly

Calls 4

CallFunction · 0.92
DoneMethod · 0.80
MessageMethod · 0.65
SessionMethod · 0.65

Tested by

no test coverage detected