Documentation
¶
Index ¶
- func NewBroker(ctx context.Context, option ...Option) (pubsub.Broker, error)
- type Logger
- type Option
- func WithAddress(address string) Option
- func WithDeliverTimeout(to time.Duration) Option
- func WithJanitorConsumerTimeout(janitorConsumerTimeout time.Duration) Option
- func WithJanitorFrequency(janitorFrequency time.Duration) Option
- func WithLogger(logger Logger) Option
- func WithPendingIdleTime(pendingIdleTime time.Duration) Option
- func WithReadGroupTimeout(readGroupTimeout time.Duration) Option
- func WithTrimDuration(trimDuration time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { Debugf(format string, v ...interface{}) Infof(format string, v ...interface{}) Warnf(format string, v ...interface{}) Errorf(format string, v ...interface{}) }
Logger is the interface that provides methods to log messages.
type Option ¶
type Option func(*options)
Option represents an option that can be passed to redis broker.
func WithAddress ¶
WithAddress sets the address of the redis server.
func WithDeliverTimeout ¶
WithDeliverTimeout how long to wait trying to send a message to a handler until we consider it has timed out. Default: 10s.
func WithJanitorConsumerTimeout ¶
WithJanitorConsumerTimeout threshold for an "old" consumer. Default: 1 day.
func WithJanitorFrequency ¶
WithJanitorFrequency how often do we run the janitor. Default: 4 hour.
func WithLogger ¶
WithLogger defines a logger for the broker. Default: noop logger.
func WithPendingIdleTime ¶
WithPendingIdleTime how long in pending before we claim a message from a different consumer. Default: 1 minute.
func WithReadGroupTimeout ¶
WithReadGroupTimeout how long to block on call to redis. Default: 10s.
func WithTrimDuration ¶
WithTrimDuration oldest event in stream. Default: 5 days.