Documentation
¶
Overview ¶
Package queue manage queue's logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(queueMaxLen int, publisher NoticePublisher) *Manager
func (*Manager) GetRawQueue ¶
manually lock (by call Lock) manually publish notice (by call PublishNotice)
func (*Manager) GetSyncQueue ¶
automatically lock automatically publish notice
type NoticePublisher ¶
func NewRedisPublisher ¶
func NewRedisPublisher(conf *RedisPublisherConfig) NoticePublisher
type Queue ¶
type Queue interface {
sync.Locker
// lockfree
Name() string
Len() int
// ErrRunOut ErrAlreadyExist
Push(key, value string, priority int64, force bool) (pos protodef.QUEUEPOS, rank int, err error)
// ErrRunOut ErrAlreadyExist
Repush(key, value string, pos protodef.QUEUEPOS) (rank int, err error)
// ErrRunOut
Pop(numMin, numMax int) (pops []protodef.PopElement, err error)
// ErrNotFound
Remove(key string, pos protodef.QUEUEPOS) error
// concurrently-access
PublishNotice()
}
Click to show internal directories.
Click to hide internal directories.