stream

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisStream

func NewRedisStream(config config.MQConfig, logger zerolog.Logger) (mq.MQ, error)

NewRedisStream returns a mq.MQ implement with redis

Types

type Consumer

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

func NewConsumer

func NewConsumer(queue string, processTimeout time.Duration, logger zerolog.Logger, process func(context.Context, []byte) error) *Consumer

func (*Consumer) Consume

func (consumer *Consumer) Consume(delivery rmq.Delivery)

type RedisStream

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

func (*RedisStream) InitSubscriber

func (stream *RedisStream) InitSubscriber(ctx context.Context, projectID, topicID string, subIDs ...string) error

func (*RedisStream) InitTopic

func (stream *RedisStream) InitTopic(ctx context.Context, projectID, topicID string) error

func (*RedisStream) Publish

func (stream *RedisStream) Publish(distributedID int64, projectID, topicID string, message []byte) error

func (*RedisStream) Stop

func (stream *RedisStream) Stop()

func (*RedisStream) Subscribe

func (stream *RedisStream) Subscribe(projectID, subscription string, process func(context.Context, []byte) error) error

Jump to

Keyboard shortcuts

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