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

Function NewBroker

pkg/streamclient/streambroker.go:40–52  ·  view source on GitHub ↗
(rpcClient StreamRpcInterface)

Source from the content-addressed store, hash-verified

38}
39
40func NewBroker(rpcClient StreamRpcInterface) *Broker {
41 b := &Broker{
42 rpcClient: rpcClient,
43 readers: make(map[string]*Reader),
44 writers: make(map[string]StreamWriter),
45 readerRoutes: make(map[string]string),
46 writerRoutes: make(map[string]string),
47 readerErrorSentTime: make(map[string]time.Time),
48 }
49 b.sendQueue = utilds.NewWorkQueue(b.processSendWork)
50 b.recvQueue = utilds.NewWorkQueue(b.processRecvWork)
51 return b
52}
53
54func (b *Broker) CreateStreamReader(readerRoute string, writerRoute string, rwnd int64) (*Reader, *wshrpc.StreamMeta) {
55 return b.CreateStreamReaderWithSeq(readerRoute, writerRoute, rwnd, 0)

Callers 3

MakeWshRpcWithChannelsFunction · 0.92
runTestFunction · 0.92
setupBrokerPairFunction · 0.85

Calls 1

NewWorkQueueFunction · 0.92

Tested by 1

setupBrokerPairFunction · 0.68