package
Version:
v1.0.0-rc.3
Opens a new window with list of versions in this module.
Published: Feb 4, 2023
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.
Offer adds an element to the queue and returns true.
If the queue is full, it drops it and returns false.
func (queue *Queue[T]) Poll() (element T, success bool)
Poll returns and removes the oldest element in the queue and true if successful.
If returns false if the queue is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.