redispub

package
Version: v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GroupExistErrorMsg        = "BUSYGROUP Consumer Group name already exists"
	SubscriptionExistsAlready = "String is already subscribed to"
)

Variables

View Source
var (
	DefaultMessageBatchCount = 200
	DefaultMessageBatchWait  = 700 * time.Millisecond
)

Functions

This section is empty.

Types

type Channel

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

Channel implements the sabuhp.Channel interface.

func (*Channel) Close

func (r *Channel) Close()

type Config

type Config struct {
	Logger                    sabuhp.Logger
	Ctx                       context.Context
	Codec                     sabuhp.Codec
	Redis                     redis.Options
	MaxWaitForSubConfirmation time.Duration
	StreamMessageInterval     time.Duration
	MaxWaitForSubRetry        int
	MaxMessageBatch           int
	MaxMessageBatchWait       time.Duration
}

type MessageChannel

type MessageChannel int
const (
	RedisPubSub MessageChannel = iota
	RedisStreams
)

type RedisMessageBus

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

func NewRedisMessageBus

func NewRedisMessageBus(config Config, client *redis.Client, channel MessageChannel) *RedisMessageBus

func PubSub

func PubSub(config Config) (*RedisMessageBus, error)

func Stream

func Stream(config Config) (*RedisMessageBus, error)

func (*RedisMessageBus) Listen

func (r *RedisMessageBus) Listen(topic string, grp string, handler sabuhp.TransportResponse) sabuhp.Channel

func (*RedisMessageBus) ListenPubSub

func (r *RedisMessageBus) ListenPubSub(topic string, grp string, handler sabuhp.TransportResponse) sabuhp.Channel

func (*RedisMessageBus) ListenStream

func (r *RedisMessageBus) ListenStream(streamTopic string, grp string, handler sabuhp.TransportResponse) sabuhp.Channel

func (*RedisMessageBus) Send

func (r *RedisMessageBus) Send(data ...sabuhp.Message)

func (*RedisMessageBus) SendForReply added in v0.5.1

func (r *RedisMessageBus) SendForReply(tm time.Duration, fromTopic sabuhp.Topic, replyGroup string, data ...sabuhp.Message) *nthen.Future

func (*RedisMessageBus) Start

func (r *RedisMessageBus) Start()

func (*RedisMessageBus) Stop

func (r *RedisMessageBus) Stop()

func (*RedisMessageBus) Wait

func (r *RedisMessageBus) Wait()

Source Files

Jump to

Keyboard shortcuts

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