Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OffsetNotFoundError = queueEB(errors.New("offset not found")) IsEmpty = queueEB(errors.New("queue is empty")) )
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[Element any] struct { // contains filtered or unexported fields }
Queue - sized queue. All public operations:
- GetAll - GetByOffset - Append
execs synchronously using sync.RWMutex to prevent race condition.
func NewQueue ¶
func NewQueue[Element any](configuration configuration.Queue) *Queue[Element]
NewQueue - Queue constructor.
func (*Queue[Element]) GetAll ¶
func (q *Queue[Element]) GetAll() []Element
GetAll - return all queued elements.
func (*Queue[Element]) GetByOffset ¶
GetByOffset - return an element by its offset. If the offset too old and not represent at the queue returns the oldest element and its offset. If the offset gte q.max returns error and last element offset.
Click to show internal directories.
Click to hide internal directories.