package
Version:
v1.0.0-beta.3
Opens a new window with list of versions in this module.
Published: Aug 12, 2022
License: Apache-2.0, BSD-2-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Queue represents a ring buffer.
New creates a new queue with the specified capacity.
Capacity returns the capacity of the queue.
func (queue *Queue) Offer(element interface{}) bool
Offer adds an element to the queue and returns true.
If the queue is full, it drops it and returns false.
func (queue *Queue) Poll() (element interface{}, success bool)
Poll returns and removes the oldest element in the queue and true if successful.
If returns false if the queue is empty.
Size returns the size of the queue.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.