package
Version:
v0.1.9
Opens a new window with list of versions in this module.
Published: Aug 9, 2021
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Queue struct {
C chan interface{}
}
Queue 队列
New 创建一个新的队列
如果传入了limit则表示是一个固定大小的队列,底层直接使用标准库的channel驱动。
func (that *Queue) Close()
Close 关闭队列
Len 返回队列长度,队列长度等于 在list列表中的数据 + 在C通道中的数据
func (that *Queue) Pop() interface{}
Pop 出队消费
func (that *Queue) Push(v interface{})
Push 入队
Source Files
¶
Click to show internal directories.
Click to hide internal directories.