Documentation ¶
Index ¶
- type Unbounded
- func (q *Unbounded[T]) Cap() int
- func (q *Unbounded[T]) Close()
- func (q *Unbounded[T]) CloseRemaining() []T
- func (q *Unbounded[T]) IsClosed() bool
- func (q *Unbounded[T]) IsEmpty() bool
- func (q *Unbounded[T]) Len() int
- func (q *Unbounded[T]) Pop() (T, bool)
- func (q *Unbounded[T]) Push(i T) bool
- func (q *Unbounded[T]) Wait() (T, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Unbounded ¶
type Unbounded[T any] struct { // contains filtered or unexported fields }
Unbounded thread-safe Queue using ring-buffer reference: https://blog.dubbelboer.com/2015/04/25/go-faster-queue.html https://github.com/eapache/queue
func NewUnbounded ¶
NewUnbounded creates an instance of Unbounded
func (*Unbounded[T]) Close ¶
func (q *Unbounded[T]) Close()
Close the queue and discard all entries in the queue all goroutines in wait() will return
func (*Unbounded[T]) CloseRemaining ¶
func (q *Unbounded[T]) CloseRemaining() []T
CloseRemaining will close the queue and return all entries in the queue. All goroutines in wait() will return.
func (*Unbounded[T]) IsClosed ¶
IsClosed returns true if the queue has been closed The call cannot guarantee that the queue hasn't been closed while the function returns, so only "true" has a definite meaning.
func (*Unbounded[T]) Pop ¶
Pop removes the item from the front of the queue If false is returned, it either means 1) there were no items on the queue or 2) the queue is closed.