Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Now clock = func() int64 { return time.Now().UnixNano() }
Now gets the current time in Unix nanoseconds
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
BufferPool represents a thread safe buffer pool
func NewBufferPool ¶
func NewBufferPool(bufferSize int) (bp *BufferPool)
NewBufferPool creates a new BufferPool bounded to the given size.
func (*BufferPool) Get ¶
func (bp *BufferPool) Get() *bytes.Buffer
Get gets a Buffer from the SizedBufferPool, or creates a new one if none are available in the pool. Buffers have a pre-allocated capacity.
func (*BufferPool) Put ¶
func (bp *BufferPool) Put(b *bytes.Buffer)
Put returns the given Buffer to the SizedBufferPool.
type LWWSet ¶
LWWSet represents a last-write-wins CRDT set.
func NewLWWSet ¶
func NewLWWSet() *LWWSet
NewLWWSet creates a new last-write-wins set with bias for 'add'.
func (*LWWSet) GC ¶
func (s *LWWSet) GC()
GC collects all the garbage in the set by simply removing it. This currently uses a very simplistic strategy with a static cutoff and expects all of the nodes in the cluster to have a relatively synchronized time, in absense of which this would cause inconsistency.