goring

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 2 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 {
	// contains filtered or unexported fields
}

func New

func New(initialSize int64) *Queue

New 创建一个新的队列对象

func (*Queue) Destroy

func (q *Queue) Destroy()

Destory 销毁队列对象

func (*Queue) Empty

func (q *Queue) Empty() bool

Empty 检查队列是否为空

func (*Queue) Length

func (q *Queue) Length() int64

Length 获取队列中的元素个数

func (*Queue) Pop

func (q *Queue) Pop() (interface{}, bool)

Pop 从队列头部弹出一个元素(单个消费者)

func (*Queue) PopMany

func (q *Queue) PopMany(count int64) ([]interface{}, bool)

PopMany 从队列头部弹出多个元素(单个消费者)

func (*Queue) Push

func (q *Queue) Push(item interface{})

Push 向队列尾部插入一个元素

Jump to

Keyboard shortcuts

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