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

Method writeData

pkg/wshutil/wshcmdreader.go:148–157  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

146}
147
148func (b *PtyBuffer) writeData(data []byte) {
149 b.CVar.L.Lock()
150 defer b.CVar.L.Unlock()
151 // only wait if buffer is currently over max size, otherwise allow this append to go through
152 for b.DataBuf.Len() > MaxBufferedDataSize {
153 b.CVar.Wait()
154 }
155 b.DataBuf.Write(data)
156 b.CVar.Broadcast()
157}
158
159func (b *PtyBuffer) Read(p []byte) (n int, err error) {
160 b.CVar.L.Lock()

Callers 1

processDataMethod · 0.95

Calls 3

LenMethod · 0.80
WaitMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected