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

Method appendBufs

nats.go:2180–2195  ·  view source on GitHub ↗
(bufs ...[]byte)

Source from the content-addressed store, hash-verified

2178}
2179
2180func (w *natsWriter) appendBufs(bufs ...[]byte) error {
2181 for _, buf := range bufs {
2182 if len(buf) == 0 {
2183 continue
2184 }
2185 if w.pending != nil {
2186 w.pending.Write(buf)
2187 } else {
2188 w.bufs = append(w.bufs, buf...)
2189 }
2190 }
2191 if w.pending == nil && len(w.bufs) >= w.limit {
2192 return w.flush()
2193 }
2194 return nil
2195}
2196
2197func (w *natsWriter) writeDirect(strs ...string) error {
2198 for _, str := range strs {

Callers 2

appendStringMethod · 0.95
publishMethod · 0.80

Calls 2

flushMethod · 0.95
WriteMethod · 0.45

Tested by

no test coverage detected