MCPcopy
hub / github.com/nats-io/nats.go / flushPendingBuffer

Method flushPendingBuffer

nats.go:2232–2241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2230}
2231
2232func (w *natsWriter) flushPendingBuffer() error {
2233 if w.pending == nil || w.pending.Len() == 0 {
2234 return nil
2235 }
2236 _, err := w.w.Write(w.pending.Bytes())
2237 // Reset the pending buffer at this point because we don't want
2238 // to take the risk of sending duplicates or partials.
2239 w.pending.Reset()
2240 return err
2241}
2242
2243func (w *natsWriter) atLimitIfUsingPending() bool {
2244 if w.pending == nil {

Callers 1

Calls 3

BytesMethod · 0.65
ResetMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected