queue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeMsgHandler

type ConsumeMsgHandler func(info *MsgInfo, msg map[string]interface{}) error

type MsgInfo

type MsgInfo struct {
	Topic    string
	Group    string
	Consumer string
	MsgId    string
}

type SQueue

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

func NewSQueue

func NewSQueue(c *rredis.Redis) *SQueue

func (*SQueue) Consume

func (s *SQueue) Consume(ctx context.Context, topic, group, consumer string, batchSize int, handler ConsumeMsgHandler) error

func (*SQueue) Count

func (s *SQueue) Count(ctx context.Context, topic string) int64

func (*SQueue) Publish

func (s *SQueue) Publish(ctx context.Context, topic string, msg map[string]interface{}) error

func (*SQueue) SetMaxCount

func (s *SQueue) SetMaxCount(ctx context.Context, topic string, max int64) error

Jump to

Keyboard shortcuts

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