class PrivateParlorXT::MessageQueue
- PrivateParlorXT::MessageQueue
- Reference
- Object
Overview
A container for messages ready to be sent to Telegram
Defined in:
private-parlor-xt/relay/queue.crConstructors
Instance Method Summary
-
#enqueue(cached_msid : Int64 | Array(Int64), sender_id : Int64 | Nil, receiver_ids : Array(Int64), reply_msids : Hash(Int64, ReplyParameters), func : MessageProc) : Nil
Creates a new
QueuedMessage
and pushes it to the back of the queue. -
#enqueue_priority(receiver_id : Int64, reply : ReplyParameters | Nil, func : MessageProc) : Nil
Creates a new
QueuedMessage
and pushes it to the front of the queue. -
#get_message : QueuedMessage | Nil
Returns the first
QueuedMessage
in the#queue
if it is available -
#queue : Deque(QueuedMessage)
A double-ended queue of
QueuedMessage
; enqueued user messages are sent to the back of the queue, while system messages are sent to the front. -
#queue_mutex : Mutex
Provides mutually exclusion for elements in the queue.
-
#reject_messages(&) : Nil
Removes messsages from queue based on if the given block is truthy
Constructor Detail
Instance Method Detail
Creates a new QueuedMessage
and pushes it to the back of the queue.
Creates a new QueuedMessage
and pushes it to the front of the queue.
Useful for reply messages.
Returns the first QueuedMessage
in the #queue
if it is available
Returns nil
if there is no QueuedMessage
in the #queue
A double-ended queue of QueuedMessage
; enqueued user messages are sent to the back of the queue, while system messages are sent to the front.
Provides mutually exclusion for elements in the queue. Assume that it is necessary when interacting with the queue.