This commit is contained in:
JackDoan
2026-05-14 13:40:40 -05:00
parent 697294a676
commit c4deb5fc1c
8 changed files with 37 additions and 62 deletions

12
overlay/batch/rx_batch.go Normal file
View File

@@ -0,0 +1,12 @@
package batch
type RxBatcher interface {
// Reserve creates a pkt to borrow
Reserve(sz int) []byte
// Commit borrows pkt. The caller must keep pkt valid until the next Flush
Commit(pkt []byte) error
// Flush emits every queued packet in arrival order. Returns the
// first error observed; keeps draining so one bad packet doesn't hold up
// the rest. After Flush returns, borrowed payload slices may be recycled.
Flush() error
}