redissubscriber

package
v0.0.0-...-2ba4c8d Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NORMAL = 0
	CLOSED = 1
)

Variables

This section is empty.

Functions

func New

func New(clientOpt ClientOption, opts ...Option) easypubsub.Subscriber

Types

type ChannelGenerator

type ChannelGenerator func(topic string) (channel string)

type ClientOption

type ClientOption func(o *clientOptions)

func ClusterClient

func ClusterClient(opts *redis.ClusterOptions) ClientOption

func FailoverClient

func FailoverClient(opts *redis.FailoverOptions) ClientOption

func SampleClient

func SampleClient(opts *redis.Options) ClientOption

type MsgUnmarshaler

type MsgUnmarshaler func(ctx context.Context, topic string, redisMsg *redis.Message) (msg *easypubsub.Message, err error)

type Option

type Option func(o *options)

func WithChannelGenerator

func WithChannelGenerator(generateChannel ChannelGenerator) Option

func WithEnablePatternSubscribe

func WithEnablePatternSubscribe() Option

func WithLogger

func WithLogger(logger easypubsub.Logger) Option

func WithMsgUnmarshaler

func WithMsgUnmarshaler(unmarshalMsg MsgUnmarshaler) Option

func WithNackResendBackoff

func WithNackResendBackoff(nackResendBackoff backoffutils.BackoffFunc) Option

func WithNackResendMaxAttempt

func WithNackResendMaxAttempt(nackResendMaxAttempt uint) Option

func WithPatternGenerator

func WithPatternGenerator(generatePattern PatternGenerator) Option

func WithReSubBackoff

func WithReSubBackoff(reSubBackoff backoffutils.BackoffFunc) Option

func WithReSubMaxAttempt

func WithReSubMaxAttempt(reSubMaxAttempt uint) Option

type PatternGenerator

type PatternGenerator func(topic string) (channel string)

type Subscriber

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

func (*Subscriber) Close

func (sub *Subscriber) Close() error

func (*Subscriber) String

func (sub *Subscriber) String() string

func (*Subscriber) Subscribe

func (sub *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *easypubsub.Message, <-chan error)

Jump to

Keyboard shortcuts

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