Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CQueue ¶
type CQueue[T any] struct { // contains filtered or unexported fields }
CQueue is a concurrent unbounded queue which uses two-Lock concurrent queue algorithm.
func (*CQueue[T]) DequeueAsType ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a lock-free unbounded queue.
func (*Queue[T]) DequeueAsType ¶
type SliceQueue ¶
type SliceQueue[T any] struct { // contains filtered or unexported fields }
SliceQueue is an unbounded queue which uses a slice as underlying.
func NewSliceQueue ¶
func NewSliceQueue[T any](n int) (q *SliceQueue[T])
NewSliceQueue returns an empty queue. You can give a initial capacity.
func (*SliceQueue[T]) Dequeue ¶
func (q *SliceQueue[T]) Dequeue() interface{}
func (*SliceQueue[T]) DequeueAsType ¶
func (q *SliceQueue[T]) DequeueAsType() (T, bool)
func (*SliceQueue[T]) Enqueue ¶
func (q *SliceQueue[T]) Enqueue(v T)
Enqueue puts the given value v at the tail of the queue.
Click to show internal directories.
Click to hide internal directories.