PrivateParlorXT::MessageQueue
Inherits Reference < Object
A container for messages ready to be sent to Telegram
Constructors
new
SourceInstance methods
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.
Useful for reply messages.
get_message
Returns the first QueuedMessage in the queue if it is available
Returns nil if there is no QueuedMessage in the queue
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.
queue_mutex
Provides mutually exclusion for elements in the queue. Assume that it is necessary when interacting with the queue.