Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { ID string `json:"id"` Name string `json:"name"` Payload string `json:"payload"` }
Message represents messages stored on the queue
type Queue ¶
type Queue interface { Add(messageName string, payload []byte) error AddMessage(message Message) error StartConsuming(size int, pollInterval time.Duration, callback func(Message) error) }
Queue defines the interface for a message queue
type RedisQueue ¶
RedisQueue implements the Queue interface for a Redis based message queue
func NewRedisQueue ¶
func NewRedisQueue(connectionString string, queueName string) (*RedisQueue, error)
NewRedisQueue creates a new RedisQueue
func (*RedisQueue) Add ¶
func (r *RedisQueue) Add(messageName string, payload []byte) error
Add a new message with the given payload to the queue
func (*RedisQueue) AddMessage ¶
func (r *RedisQueue) AddMessage(message Message) error
AddMessage to the queue, generating a unique ID for the message before dispatc
func (*RedisQueue) Consume ¶
func (r *RedisQueue) Consume(delivery rmq.Delivery)
Consume is the internal callback for the message queue
func (*RedisQueue) StartConsuming ¶
func (r *RedisQueue) StartConsuming(size int, pollInterval time.Duration, callback func(Message) error)
StartConsuming consumes messages from the queue
Click to show internal directories.
Click to hide internal directories.