wab

package
v0.10.3-0...-aba39ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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

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

Next returns the next message in the buffer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL