umq

package
v0.0.0-...-b952f1b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUMq

type IUMq interface {
	// Subscribe 订阅
	Subscribe(ctx context.Context, topics ...string) error
	// UnSubscribe 取消订阅
	UnSubscribe(ctx context.Context, topics ...string) error
	// Publish 发布
	Publish(ctx context.Context, topic string, msg string) error
	// Dequeue 获取消息
	Dequeue(ctx context.Context) (string, []byte, error)
}

type RedisListPub

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

func NewRedisListQueue

func NewRedisListQueue(ctx context.Context, redisDb *dbs.RedisDb, timeout time.Duration) *RedisListPub

func (*RedisListPub) Dequeue

func (q *RedisListPub) Dequeue(ctx context.Context) (string, []byte, error)

func (*RedisListPub) Publish

func (q *RedisListPub) Publish(ctx context.Context, topic string, msg string) error

func (*RedisListPub) Subscribe

func (q *RedisListPub) Subscribe(ctx context.Context, topics ...string) error

func (*RedisListPub) UnSubscribe

func (q *RedisListPub) UnSubscribe(ctx context.Context, topics ...string) error

type RedisPub

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

func NewRedisQueue

func NewRedisQueue(ctx context.Context, redisDb *dbs.RedisDb) *RedisPub

func (*RedisPub) Dequeue

func (q *RedisPub) Dequeue(ctx context.Context) (string, []byte, error)

func (*RedisPub) Publish

func (q *RedisPub) Publish(ctx context.Context, topic string, msg string) error

func (*RedisPub) Subscribe

func (q *RedisPub) Subscribe(ctx context.Context, topics ...string) error

func (*RedisPub) UnSubscribe

func (q *RedisPub) UnSubscribe(ctx context.Context, topics ...string) error

Jump to

Keyboard shortcuts

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