dqueue

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	C chan interface{} // 读取数据的channel
	// contains filtered or unexported fields
}

Queue 队列

func New

func New(limit ...int) *Queue

New 创建一个新的队列 如果传入了limit则表示是一个固定大小的队列,底层直接使用标准库的channel驱动。

func (*Queue) Close

func (that *Queue) Close()

Close 关闭队列

func (*Queue) Len

func (that *Queue) Len() (length int)

Len 返回队列长度,队列长度等于 在list列表中的数据 + 在C通道中的数据

func (*Queue) Pop

func (that *Queue) Pop() interface{}

Pop 出队消费

func (*Queue) Push

func (that *Queue) Push(v interface{})

Push 入队

func (*Queue) Size

func (that *Queue) Size() int

Size len的别名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL