mirror of
https://github.com/slackhq/nebula.git
synced 2026-05-16 21:07:36 +02:00
13 lines
438 B
Go
13 lines
438 B
Go
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
|
|
}
|