MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / testCaller

Function testCaller

rpc/pool_test.go:57–73  ·  view source on GitHub ↗
(c C, wg *sync.WaitGroup, pool NOClientPool, remote proto.NodeID, con int, quest int)

Source from the content-addressed store, hash-verified

55}
56
57func testCaller(c C, wg *sync.WaitGroup, pool NOClientPool, remote proto.NodeID, con int, quest int) {
58 defer wg.Done()
59 var finished int32
60 caller := NewCallerWithPool(pool)
61 iwg := &sync.WaitGroup{}
62 defer iwg.Wait()
63 for i := 0; i < con; i++ {
64 iwg.Add(1)
65 go func(c C) {
66 defer iwg.Done()
67 for atomic.AddInt32(&finished, 1) < int32(quest) {
68 err := caller.CallNode(remote, "Count.Add", &AddReq{Delta: 1}, &AddResp{})
69 c.So(err, ShouldBeNil)
70 }
71 }(c)
72 }
73}
74
75func testPCaller(c C, wg *sync.WaitGroup, pool NOClientPool, remote proto.NodeID, con int, quest int) {
76 defer wg.Done()

Callers 1

TestRPCComponentsFunction · 0.85

Calls 4

NewCallerWithPoolFunction · 0.85
WaitMethod · 0.80
CallNodeMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected