Documentation
¶
Overview ¶
Package delta provides bounded batching and coalescing for encoded CRDT deltas. It does not choose a network transport or retry policy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch contains immutable copies of encoded delta frames.
func UnmarshalBatch ¶
UnmarshalBatch accepts one complete canonical batch envelope and copies its items. maxItems and maxBytes bound both allocation and parsing work.
type Coalescer ¶
type Coalescer struct {
// contains filtered or unexported fields
}
Coalescer stores a bounded stream of same-type encoded deltas. With merge set, Add replaces the tail with its join, avoiding a scan of earlier items. With nil merge it is a bounded FIFO batch builder.
func NewCoalescer ¶
NewCoalescer creates an empty bounded coalescer.
func (*Coalescer) Add ¶
Add validates item as a CRDT frame and appends or joins it. On error the coalescer is unchanged.