Documentation
¶
Index ¶
- type MessageQueue
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) MessageQueue(subject string) (queue.MessageQueue, error)
- func (p *Provider) PublishToTopic(ctx context.Context, topic string, payload string) error
- func (p *Provider) QueueSubscribe(ctx context.Context, subject string, handler func(queue.DeliverMessage)) (queue.Subscription, error)
- func (p *Provider) RequestReply(ctx context.Context, topic string, payload string) (*queue.Message, error)
- func (p *Provider) SubscribeToTopic(ctx context.Context, topic string, handler func(queue.DeliverMessage)) (queue.Subscription, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
MessageQueue implements the MessageQueue interface using Redis.
func (*MessageQueue) Size ¶
func (q *MessageQueue) Size() int64
Size returns the number of messages in the queue.
func (*MessageQueue) Subscribe ¶
func (q *MessageQueue) Subscribe(ctx context.Context, handler func(queue.DeliverMessage)) error
Subscribe to the queue and process the messages.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the MessageQueueProvider using Redis.
func NewProvider ¶
NewProvider creates a new Provider.
func (*Provider) MessageQueue ¶
func (p *Provider) MessageQueue(subject string) (queue.MessageQueue, error)
MessageQueue obtains the corresponding MessageQueue based on subject.
func (*Provider) PublishToTopic ¶
PublishToTopic publishes a message to the specified topic.
func (*Provider) QueueSubscribe ¶
func (p *Provider) QueueSubscribe(ctx context.Context, subject string, handler func(queue.DeliverMessage)) (queue.Subscription, error)
QueueSubscribe creates a queue subscription.
func (*Provider) RequestReply ¶
func (p *Provider) RequestReply(ctx context.Context, topic string, payload string) (*queue.Message, error)
RequestReply sends a request and waits for a response.
func (*Provider) SubscribeToTopic ¶
func (p *Provider) SubscribeToTopic(ctx context.Context, topic string, handler func(queue.DeliverMessage)) (queue.Subscription, error)
SubscribeToTopic subscribes to messages for a specified topic.
Click to show internal directories.
Click to hide internal directories.