MCPcopy
hub / github.com/PatchMon/PatchMon / Write

Method Write

agent-source-code/cmd/patchmon-agent/commands/serve.go:2084–2094  ·  view source on GitHub ↗

Write records bytes into both the fullOutput builder and the pending flush buffer. It triggers a flush when thresholds are reached.

(p []byte)

Source from the content-addressed store, hash-verified

2082// Write records bytes into both the fullOutput builder and the pending flush
2083// buffer. It triggers a flush when thresholds are reached.
2084func (s *streamSink) Write(p []byte) (int, error) {
2085 s.mu.Lock()
2086 s.full.Write(p)
2087 s.pending.Write(p)
2088 shouldFlush := s.pending.Len() >= s.flushBytes || time.Since(s.lastFlush) >= s.flushEvery
2089 s.mu.Unlock()
2090 if shouldFlush {
2091 s.Flush()
2092 }
2093 return len(p), nil
2094}
2095
2096// WriteString is a convenience wrapper for appending a string.
2097func (s *streamSink) WriteString(str string) {

Callers 15

WriteStringMethod · 0.95
hashStringFunction · 0.80
runStreamingPatchStepFunction · 0.80
handleSSHProxyInputFunction · 0.80
handleRDPProxyInputFunction · 0.80
BuildScheduledReportFunction · 0.80
bridgeAgentToGuacdMethod · 0.80
rateLimitUnavailableFunction · 0.80
RateLimitFunction · 0.80
RateLimitAgentByAPIIDFunction · 0.80
CORSFunction · 0.80

Calls 1

FlushMethod · 0.95