()
| 2230 | } |
| 2231 | |
| 2232 | func (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 | |
| 2243 | func (w *natsWriter) atLimitIfUsingPending() bool { |
| 2244 | if w.pending == nil { |
no test coverage detected