Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAckFailed = errors.New("ack failed")
View Source
var ErrAckNotAvailable = errors.New("ack is not available for this message, only safe popped message can be acked")
View Source
var ErrAckPopEOF = errors.New("EOF while ackPop")
View Source
var ErrAckPopFailed = errors.New("redis queue safePop failed")
View Source
var ErrPopFailed = errors.New("redis queue pop failed")
View Source
var ErrPushFailed = errors.New("redis queue push failed")
View Source
var ErrTimestampUpdateFailed = errors.New("timestamp update failed")
View Source
var ErrUnexpectedType = errors.New("redis queue message is unexpected type")
Functions ¶
This section is empty.
Types ¶
type CommonMessage ¶
type CommonMessage struct {
// contains filtered or unexported fields
}
CommonMessage is a simple message
func NewCommonMessage ¶
func NewCommonMessage(payload string) *CommonMessage
func (*CommonMessage) Payload ¶
func (msg *CommonMessage) Payload() string
type CommonQueue ¶
type CommonQueue struct { Name string // contains filtered or unexported fields }
CommonQueue is a simple queue
func NewCommonQueue ¶
func NewCommonQueue(cfg *Config) *CommonQueue
func (*CommonQueue) Pop ¶
func (q *CommonQueue) Pop() (msg Message, err error)
func (*CommonQueue) Push ¶
func (q *CommonQueue) Push(payload string) (err error)
type SafeMessage ¶
type SafeMessage struct {
// contains filtered or unexported fields
}
SafeMessage is a message that can be acked. When you receive a message from SafePop, you can ack it. If you don't ack it, the message will be popped again after a while.
func NewSafeMessage ¶
func NewSafeMessage(payload string, queue *SafeQueue) *SafeMessage
func (*SafeMessage) Ack ¶
func (msg *SafeMessage) Ack() error
func (*SafeMessage) Payload ¶
func (msg *SafeMessage) Payload() string
type SafeQueue ¶
func NewSafeQueue ¶
func (*SafeQueue) SafePop ¶
func (q *SafeQueue) SafePop() (msg *SafeMessage, err error)
Click to show internal directories.
Click to hide internal directories.