MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / StreamManager

Struct StreamManager

pkg/jobmanager/streammanager.go:33–63  ·  view source on GitHub ↗

StreamManager handles PTY output buffering with ACK-based flow control

Source from the content-addressed store, hash-verified

31
32// StreamManager handles PTY output buffering with ACK-based flow control
33type StreamManager struct {
34 lock sync.Mutex
35 drainCond *sync.Cond
36
37 streamId string
38
39 // this is the data read from the attached reader
40 buf *CirBuf
41 terminalEvent *streamTerminalEvent
42 eofPos int64 // fixed position when EOF/error occurs (-1 if not yet)
43
44 reader io.Reader
45
46 cwndSize int
47 rwndSize int
48 // invariant: if connected is true, dataSender is non-nil
49 connected bool
50 dataSender DataSender
51
52 // unacked state (reset on disconnect)
53 sentNotAcked int64
54 terminalEventSent bool
55
56 // track max acked to handle out-of-order ACKs (reset on disconnect)
57 maxAckedSeq int64
58 maxAckedRwnd int64
59
60 // terminal state - once true, stream is complete
61 terminalEventAcked bool
62 closed bool
63}
64
65func MakeStreamManager() *StreamManager {
66 return MakeStreamManagerWithSizes(CwndSize, CirBufSize)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected