messager

package
v0.0.0-...-25d04d4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MsgRetainDur = time.Minute * 10
	ReadBlockDur = time.Second * 1
)

Functions

This section is empty.

Types

type MsgID

type MsgID struct {
	MsTimestamp int64
	Seq         int64
}

func ParseMsgID

func ParseMsgID(s string) (*MsgID, error)

func (*MsgID) Add

func (m *MsgID) Add(t time.Duration) *MsgID

func (*MsgID) Gt

func (m *MsgID) Gt(v *MsgID) bool

func (*MsgID) String

func (m *MsgID) String() string

type RedisMessager

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

func NewRedisMessager

func NewRedisMessager(cli *redis.Client, stream string) (*RedisMessager, error)

func (*RedisMessager) Ack

func (r *RedisMessager) Ack(ctx context.Context, msgID string) error

func (*RedisMessager) DupSub

func (r *RedisMessager) DupSub(ctx context.Context) (result map[string][]byte, err error)

result: msgID -> data

func (*RedisMessager) Pub

func (r *RedisMessager) Pub(ctx context.Context, data []byte) (msgID string, err error)

Jump to

Keyboard shortcuts

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