package
Version:
v0.0.0-...-6b6cd0b
Opens a new window with list of versions in this module.
Published: Nov 1, 2022
License: MIT
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
¶
type Queue[T any] struct {
}
Generic queue gaurded by a mutex.
func (queue *Queue[T]) Dequeue() (value T, ok bool)
Take the next item off the front of the queue
If the queue is empty, ok is false
Returns true is there are no items in the queue
func (queue *Queue[T]) Enqueue(value T)
Put an item on the end of a queue
Return the number of items in the queue
func (queue *Queue[T]) Peek() (value T, ok bool)
Return the first item in the queue without removing it
If queue is empty, ok is false
Source Files
¶
Click to show internal directories.
Click to hide internal directories.