redis

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisQueueService

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

RedisQueueService implements QueueEngineInterface using Watermill RedisStream

func GetRedisQueueDriver

func GetRedisQueueDriver(cfg *models.Config) (*RedisQueueService, error)

func (*RedisQueueService) AddSubscriber

func (s *RedisQueueService) AddSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)

AddSubscriber method adds a subscriber to the Pub/Sub service and returns a pointer to the Subscriber object and an error if the operation fails.

func (*RedisQueueService) Close added in v1.3.0

func (r *RedisQueueService) Close() error

Close implements QueueEngineInterface.Close

func (*RedisQueueService) GetSubscriber

func (s *RedisQueueService) GetSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)

GetSubscriber method retrieves a subscriber from the Pub/Sub service and returns a pointer to the Subscriber object and an error if the operation fails.

func (*RedisQueueService) Publish

func (r *RedisQueueService) Publish(topic string, messages ...*message.Message) error

Publish implements message.Publisher interface

func (*RedisQueueService) RemoveSubscriber

func (s *RedisQueueService) RemoveSubscriber(ctx context.Context, userID string) error

RemoveSubscriber method removes a subscriber from the Pub/Sub service and returns an error if the operation fails.

func (*RedisQueueService) Subscribe

func (r *RedisQueueService) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)

Subscribe implements message.Subscriber interface

Jump to

Keyboard shortcuts

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