Documentation
¶
Index ¶
- type RedisQueueService
- func (s *RedisQueueService) AddSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
- func (r *RedisQueueService) Close() error
- func (s *RedisQueueService) GetSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
- func (r *RedisQueueService) Publish(topic string, messages ...*message.Message) error
- func (s *RedisQueueService) RemoveSubscriber(ctx context.Context, userID string) error
- func (r *RedisQueueService) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)
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.
Click to show internal directories.
Click to hide internal directories.