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

Method CreateStreamReaderWithSeq

pkg/streamclient/streambroker.go:58–77  ·  view source on GitHub ↗
(readerRoute string, writerRoute string, rwnd int64, startSeq int64)

Source from the content-addressed store, hash-verified

56}
57
58func (b *Broker) CreateStreamReaderWithSeq(readerRoute string, writerRoute string, rwnd int64, startSeq int64) (*Reader, *wshrpc.StreamMeta) {
59 b.lock.Lock()
60 defer b.lock.Unlock()
61
62 streamId := uuid.New().String()
63
64 reader := NewReaderWithSeq(streamId, rwnd, startSeq, b)
65 b.readers[streamId] = reader
66 b.readerRoutes[streamId] = readerRoute
67 b.writerRoutes[streamId] = writerRoute
68
69 meta := &wshrpc.StreamMeta{
70 Id: streamId,
71 RWnd: rwnd,
72 ReaderRouteId: readerRoute,
73 WriterRouteId: writerRoute,
74 }
75
76 return reader, meta
77}
78
79func (b *Broker) AttachStreamWriter(meta *wshrpc.StreamMeta, writer StreamWriter) error {
80 b.lock.Lock()

Callers 2

CreateStreamReaderMethod · 0.95
restartStreamingFunction · 0.80

Calls 2

NewReaderWithSeqFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected