Documentation
¶
Overview ¶
Package taskqueue provides a small intrusive MPSC FIFO queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[T any] struct { Value T // contains filtered or unexported fields }
Node is prepared by a producer before it enters the queue. Value is owned by the caller; the queue only links nodes.
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a multi-producer, single-consumer FIFO. Its lock only protects acceptance state and pointer linkage.
func (*Queue[T]) Drain ¶
Drain removes the complete public queue in O(1). The returned chain is private to the single consumer and remains in FIFO order.
func (*Queue[T]) HasPending ¶
HasPending reports whether public work is waiting.