Documentation ¶
Index ¶
- type Message
- type MessageQueue
- func (mq *MessageQueue) Clear()
- func (mq *MessageQueue) Length() int
- func (mq *MessageQueue) Peek() Message
- func (mq *MessageQueue) Pop() Message
- func (mq *MessageQueue) Push(message Message)
- func (mq *MessageQueue) WaitAndPop(timeout time.Duration) Message
- func (mq *MessageQueue) WaitAndPopWithTimeout(timeout time.Duration) Message
- type PayLoad
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageQueue ¶
type MessageQueue struct { QueueID string QueuName string DocDBconn *documents.DocDB DB *sql.DB SignalRClient signalr.Client // contains filtered or unexported fields }
func NewMessageQueue ¶
func NewMessageQueue(Id string, Name string) *MessageQueue
func (*MessageQueue) Clear ¶
func (mq *MessageQueue) Clear()
func (*MessageQueue) Length ¶
func (mq *MessageQueue) Length() int
Length returns the number of messages in the message queue.
func (*MessageQueue) Peek ¶
func (mq *MessageQueue) Peek() Message
Peek returns the first message in the message queue without removing it. If the queue is empty, it returns an empty Message. It measures the performance duration of the operation and logs any errors that occur.
func (*MessageQueue) Pop ¶
func (mq *MessageQueue) Pop() Message
Pop removes and returns the first message from the message queue. If the queue is empty, it returns an empty Message. It measures the performance duration of the operation and logs any errors that occur.
func (*MessageQueue) Push ¶
func (mq *MessageQueue) Push(message Message)
func (*MessageQueue) WaitAndPop ¶
func (mq *MessageQueue) WaitAndPop(timeout time.Duration) Message
WaitAndPop waits for a message to be available in the queue and then removes and returns it. If the queue is empty, it will return an empty Message struct. The timeout parameter specifies the maximum duration to wait for a message before returning. If a timeout of zero is provided, it will wait indefinitely until a message is available. It measures the performance duration of the operation and logs any errors that occur. It takes a timeout time.Duration as a parameter and returns a Message struct.
func (*MessageQueue) WaitAndPopWithTimeout ¶
func (mq *MessageQueue) WaitAndPopWithTimeout(timeout time.Duration) Message