mq

package
v0.0.0-...-c1a148e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue interface {
	Publish(ctx context.Context, payload []byte) error
	Subscribe(ctx context.Context, handler func([]byte))
	Close()
}

Queue 消息队列

func NewNatsMQ

func NewNatsMQ(conn *nats.Conn, subject string) Queue

NewNatsMQ 构造函数

func NewRedisMQ

func NewRedisMQ(client *redis.Client, channel string) Queue

NewRedisMQ 构造函数

client 可以使用 *redis.Client 或者 *redis.ClusterClient

当使用ClusterClient时,会采用sharded channel

Jump to

Keyboard shortcuts

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