package
Version:
v1.1.6
Opens a new window with list of versions in this module.
Published: Feb 25, 2026
License: MIT
Opens a new window with license information.
Imports: 2
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 {
}
Queue 封装了 UMPSCQueue 和计数器
func (q *Queue[T]) Dequeue() T
Dequeue 从队列中获取数据并更新计数器 (仅单消费者!!!)
func (q *Queue[T]) Enqueue(value T)
Enqueue 向队列中添加数据并更新计数器 (多生产者: 安全)
RateState 返回入队速率, 当前计数, 上一次计数
Source Files
¶
Click to show internal directories.
Click to hide internal directories.