MCPcopy
hub / github.com/wavetermdev/waveterm / sendRpcMessageToLink

Method sendRpcMessageToLink

pkg/wshutil/wshrouter.go:338–349  ·  view source on GitHub ↗
(linkId baseds.LinkId, client AbstractRpcClient, msgBytes []byte, ingressLinkId baseds.LinkId, debugStr string)

Source from the content-addressed store, hash-verified

336}
337
338func (router *WshRouter) sendRpcMessageToLink(linkId baseds.LinkId, client AbstractRpcClient, msgBytes []byte, ingressLinkId baseds.LinkId, debugStr string) {
339 router.lock.Lock()
340 defer router.lock.Unlock()
341 sent := false
342 backlog := router.linkMsgBacklog[linkId]
343 if len(backlog) == 0 {
344 sent = client.SendRpcMessage(msgBytes, ingressLinkId, debugStr)
345 }
346 if !sent {
347 router.addToBacklog_withlock(linkId, msgBytes, ingressLinkId, debugStr)
348 }
349}
350
351func (router *WshRouter) runServer() {
352 for input := range router.inputCh {

Callers 6

SendEventMethod · 0.95
handleNoRouteMethod · 0.95
sendRoutedMessageMethod · 0.95
sendMessageToLinkMethod · 0.95
runUpstreamBufferLoopMethod · 0.95

Calls 2

addToBacklog_withlockMethod · 0.95
SendRpcMessageMethod · 0.65

Tested by

no test coverage detected