queue

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExceedingMessageSizeLimit = fmt.Errorf("message exceeds the max page size limit")
	ErrOutOfSequenceRange        = fmt.Errorf("out of sequence range")
	ErrExceedingTotalSizeLimit   = fmt.Errorf("queue data size exceeds the max size limit")
	ErrMsgNotFound               = fmt.Errorf("message not found")
)

Functions

This section is empty.

Types

type Item added in v1.2.1

type Item struct {
	// contains filtered or unexported fields
}

type Queue

type Queue interface {
	Push(item interface{}) bool                // queue 结尾put 数据, 如果失败返回false, 插入成功返回true
	Pop() (interface{}, bool)                  // 获取消息数据
	Length() int64                             // queue 长度
	IsEmpty() bool                             // queue是否为空
	PopMany(count int64) ([]interface{}, bool) // 获取多条消息数据
}

func NewRingQueue added in v1.2.1

func NewRingQueue(initialSize int64) Queue

func NewUnLockQueue added in v1.2.1

func NewUnLockQueue(max uint64) Queue

type RingQueue

type RingQueue struct {
	// contains filtered or unexported fields
}

func (*RingQueue) IsEmpty

func (q *RingQueue) IsEmpty() bool

func (*RingQueue) Length

func (q *RingQueue) Length() int64

func (*RingQueue) Pop

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

func (*RingQueue) PopMany

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

func (*RingQueue) Push

func (q *RingQueue) Push(item interface{}) bool

type UnLockQueue added in v1.2.1

type UnLockQueue struct {
	// contains filtered or unexported fields
}

lock free queue

func (*UnLockQueue) IsEmpty added in v1.2.1

func (q *UnLockQueue) IsEmpty() bool

func (*UnLockQueue) Length added in v1.2.1

func (q *UnLockQueue) Length() int64

func (*UnLockQueue) Maxlen added in v1.2.1

func (q *UnLockQueue) Maxlen() uint64

func (*UnLockQueue) Pop added in v1.2.1

func (q *UnLockQueue) Pop() (val interface{}, ok bool)

get queue functions

func (*UnLockQueue) PopMany added in v1.2.1

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

func (*UnLockQueue) Push added in v1.2.1

func (q *UnLockQueue) Push(val interface{}) bool

Push queue functions

Jump to

Keyboard shortcuts

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