MCPcopy Create free account
hub / github.com/coder/coder / NewHeadTailBufferSized

Function NewHeadTailBufferSized

agent/agentproc/headtail.go:68–75  ·  view source on GitHub ↗

NewHeadTailBufferSized creates a HeadTailBuffer with custom head and tail sizes. This is useful for testing truncation logic with smaller buffers.

(maxHead, maxTail int)

Source from the content-addressed store, hash-verified

66// head and tail sizes. This is useful for testing truncation
67// logic with smaller buffers.
68func NewHeadTailBufferSized(maxHead, maxTail int) *HeadTailBuffer {
69 b := &HeadTailBuffer{
70 maxHead: maxHead,
71 maxTail: maxTail,
72 }
73 b.cond = sync.NewCond(&b.mu)
74 return b
75}
76
77// Write implements io.Writer. It is safe for concurrent use.
78// All bytes are accepted; the return value always equals

Calls

no outgoing calls