Documentation ¶
Overview ¶
Package batcher provides retriable batch queue: all succeed or rollback for all. In kafka it is called RecordAccumulator.
Package batcher provides retriable batch queue: all succeed or rollback for all. In kafka it is called RecordAccumulator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStopping = errors.New("batcher stopping")
)
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
type Batcher interface { // Close closes the batcher from R/W. Close() // Put writes an item to the batcher. If queue is full, it will block till // all inflight items marked success. Put(item interface{}) error // Get reads an item from the batcher. Get() (interface{}, error) // Succeed marks an item handling success. Succeed() // Fail marks an item handling failure. Fail() (rewind bool) }
Batcher is a batched queue with the sematics of all succeed and advance or any fails and retry.
func NewDisruptor ¶
NewDisruptor create a new smart disruptor batcher instance.
Click to show internal directories.
Click to hide internal directories.