Documentation ¶
Overview ¶
Package mpscqueue is a multi-producer, single-consumer queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue implements a lock-free multi-producer single-consumer queue.
The design is based on http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue.
func (*Queue[T]) Dequeue ¶
Dequeue receives a value from the queue, or returns ok=false if there weren't any values.
Dequeue is not safe to call concurrently.
Click to show internal directories.
Click to hide internal directories.