You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In terms of Telegram bot API the maximum polling time of getUpdatesis referred to as timeout. That is if there are pending updates, Telegram will return them immediately. In the other case, it will wait for timeout seconds and then answer with an empty list.
The telegram-bot Rust library has its own notion of timeouts. getUpdates' timeout is dubbederror_delay, whereas the word timeoutis used for HTTP request timeout (as parameter fortokio::time::timeout wrapper).
The default value of error_delay is 500ms, which is effectively zero because timeout must be specified in seconds. Telegram documentation discourages zero timeouts. Some bot frameworks I've used default this value to 30 seconds.
Another fact about error_delay is that it has nothing to do with errors. The same value is used in case of successful and faulty previous request.
Apart from that these peculiarities are confusing by nature, the corresponding documentation is incorrect. It claims that timeout corresponds with timeout field in getUpdates and error_delay is a delay between erroneous request and next request.
I suggest bringing implementation in line with documentation.
The text was updated successfully, but these errors were encountered:
In terms of Telegram bot API the maximum polling time of
getUpdates
is referred to astimeout
. That is if there are pending updates, Telegram will return them immediately. In the other case, it will wait for timeout seconds and then answer with an empty list.The telegram-bot Rust library has its own notion of timeouts. getUpdates' timeout is dubbed
error_delay
, whereas the wordtimeout
is used for HTTP request timeout (as parameter fortokio::time::timeout
wrapper).The default value of
error_delay
is 500ms, which is effectively zero because timeout must be specified in seconds. Telegram documentation discourages zero timeouts. Some bot frameworks I've used default this value to 30 seconds.Another fact about
error_delay
is that it has nothing to do with errors. The same value is used in case of successful and faulty previous request.Apart from that these peculiarities are confusing by nature, the corresponding documentation is incorrect. It claims that
timeout
corresponds with timeout field ingetUpdates
anderror_delay
is a delay between erroneous request and next request.I suggest bringing implementation in line with documentation.
The text was updated successfully, but these errors were encountered: