pub struct UpdatesConfiguration {
pub catch_up: bool,
pub update_queue_limit: Option<usize>,
}Expand description
Configuration that controls Client::stream_updates.
Fields§
§catch_up: boolShould the client catch-up on updates sent to it while it was offline?
By default, updates sent while the client was offline are ignored.
update_queue_limit: Option<usize>How many updates may be buffered by the client at any given time.
Telegram passively sends updates to the client through the open connection, so they must be buffered until the application has the capacity to consume them.
Upon reaching this limit, updates will be dropped, and a warning log message will be emitted (but not too often, to avoid spamming the log), in order to let the developer know that they should either change how they handle updates or increase the limit.
A limit of zero (Some(0)) indicates that updates should not be buffered.
They will be immediately dropped, and no warning will ever be emitted.
A limit of None disables the upper bound for the buffer. This is not recommended, as it
could eventually lead to memory exhaustion. This option will also not emit any warnings.
The default limit, which may change at any time, should be enough for user accounts, although bot accounts may need to increase the limit depending on their capacity.
When the limit is Some, a buffer to hold that many updates will be pre-allocated.