Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchCutter ¶
type BatchCutter struct {
// contains filtered or unexported fields
}
BatchCutter implements batch cutting
func (*BatchCutter) Add ¶
func (r *BatchCutter) Add(operations ...[]byte) uint
Add adds the given operation(s) to pending batch queue and returns the total number of pending operations.
func (*BatchCutter) AddFirst ¶
func (r *BatchCutter) AddFirst(operations ...[]byte) uint
AddFirst adds the given operation(s) to the front of the pending batch queue and returns the total number of pending operations.
func (*BatchCutter) Cut ¶
func (r *BatchCutter) Cut(force bool) (operations [][]byte, pending uint)
Cut returns the current batch along with number of items remaining in the queue. If force is false then the batch will be cut only if it has reached the max batch size (as specified in the protocol) If force is true then the batch will be cut if there is at least one operation in the batch
type Cutter ¶
type Cutter interface { // Add adds the given operation(s) to pending batch queue and returns the total // number of pending operations. Add(operation ...[]byte) uint // AddFirst adds the given operation(s) to the front of the pending batch queue // and returns the total number of pending operations. AddFirst(bytes ...[]byte) uint // Cut returns the current batch along with number of items remaining in the queue. // If force is false then the batch will be cut only if it has reached the max batch size (as specified in the protocol) // If force is true then the batch will be cut if there is at least one operation in the batch Cut(force bool) ([][]byte, uint) }
Cutter defines queue for batching document operations. It also cuts batch file based on batch size.