class

PrivateParlorXT::MessageQueue

Inherits Reference < Object

A container for messages ready to be sent to Telegram

Constructors

Instance 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.

Source
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.

Source
get_message

Returns the first QueuedMessage in the queue if it is available

Returns nil if there is no QueuedMessage in the queue

Source
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.

Source
queue_mutex

Provides mutually exclusion for elements in the queue. Assume that it is necessary when interacting with the queue.

Source
reject_messages

Removes messsages from queue based on if the given block is truthy

Source