Documentation
¶
Overview ¶
Package syncqueue provides queues for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmpty = errors.New("empty queue")
Functions ¶
This section is empty.
Types ¶
type SyncQueue ¶
type SyncQueue[T any] struct { // contains filtered or unexported fields }
SyncQueue represents an unlimited FIFO queue which can be used to synchronize goroutines.
func (*SyncQueue[T]) Get ¶
Get returns an item from the queue or waits until an item is available. The operation will be aborted when the provided context is canceled.
If there are multiple goroutines waiting it is undefined which one retrieves a new item.
func (*SyncQueue[T]) GetNoWait ¶
GetNoWait returns the item from the top of the queue or an error when the queue is empty.
Click to show internal directories.
Click to hide internal directories.