Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEvicted = errors.New("message has been evicted")
ErrEvicted is returned when the expected message has been evicted.
Functions ¶
This section is empty.
Types ¶
type ROWriteAheadBuffer ¶
type ROWriteAheadBuffer interface { // ReadFromExclusiveTimeTick reads messages from the buffer from the exclusive time tick. // Return a reader if the timetick can be consumed from the write-ahead buffer, otherwise return error. ReadFromExclusiveTimeTick(ctx context.Context, timetick uint64) (*WriteAheadBufferReader, error) }
ROWriteAheadBuffer is the interface of the read-only write-ahead buffer.
type WriteAheadBuffer ¶
type WriteAheadBuffer struct {
// contains filtered or unexported fields
}
WriteAheadBuffer is a buffer that stores messages in order of time tick.
func NewWirteAheadBuffer ¶
func NewWirteAheadBuffer( logger *log.MLogger, capacity int, keepalive time.Duration, lastConfirmedTimeTickMessage message.ImmutableMessage, ) *WriteAheadBuffer
NewWriteAheadBuffer creates a new WriteAheadBuffer.
func (*WriteAheadBuffer) Append ¶
func (w *WriteAheadBuffer) Append(msgs []message.ImmutableMessage, tsMsg message.ImmutableMessage)
Append appends a message to the buffer.
func (*WriteAheadBuffer) ReadFromExclusiveTimeTick ¶
func (w *WriteAheadBuffer) ReadFromExclusiveTimeTick(ctx context.Context, timetick uint64) (*WriteAheadBufferReader, error)
ReadFromExclusiveTimeTick reads messages from the buffer from the exclusive time tick.
type WriteAheadBufferReader ¶
type WriteAheadBufferReader struct {
// contains filtered or unexported fields
}
WriteAheadBufferReader is used to read messages from WriteAheadBuffer.
func (*WriteAheadBufferReader) Next ¶
func (r *WriteAheadBufferReader) Next(ctx context.Context) (message.ImmutableMessage, error)
Next returns the next message in the buffer.
Click to show internal directories.
Click to hide internal directories.