mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-03 11:40:11 +03:00
Make sequential_updates=True the default in sync
This commit is contained in:
parent
e94ad7ad77
commit
84f42795f0
|
@ -93,15 +93,13 @@ class TelegramBaseClient(abc.ABC):
|
||||||
times automatically if Telegram disconnects us or not.
|
times automatically if Telegram disconnects us or not.
|
||||||
|
|
||||||
sequential_updates (`bool`, optional):
|
sequential_updates (`bool`, optional):
|
||||||
By default every incoming update will create a new task, so
|
By default every incoming update will be processed under the
|
||||||
you can handle several updates in parallel. Some scripts need
|
same thread (which means they're processed in a sequential
|
||||||
the order in which updates are processed to be sequential, and
|
order).
|
||||||
this setting allows them to do so.
|
|
||||||
|
|
||||||
If set to ``True``, incoming updates will be put in a queue
|
You can disable this behaviour by setting it to ``False``
|
||||||
and processed sequentially. This means your event handlers
|
which will create a new thread per update. This gives more
|
||||||
should *not* perform long-running operations since new
|
concurrency.
|
||||||
updates are put inside of an unbounded queue.
|
|
||||||
|
|
||||||
flood_sleep_threshold (`int` | `float`, optional):
|
flood_sleep_threshold (`int` | `float`, optional):
|
||||||
The threshold below which the library should automatically
|
The threshold below which the library should automatically
|
||||||
|
@ -150,14 +148,13 @@ class TelegramBaseClient(abc.ABC):
|
||||||
request_retries=5,
|
request_retries=5,
|
||||||
connection_retries=5,
|
connection_retries=5,
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
sequential_updates=False,
|
sequential_updates=True,
|
||||||
flood_sleep_threshold=60,
|
flood_sleep_threshold=60,
|
||||||
device_model=None,
|
device_model=None,
|
||||||
system_version=None,
|
system_version=None,
|
||||||
app_version=None,
|
app_version=None,
|
||||||
lang_code='en',
|
lang_code='en',
|
||||||
system_lang_code='en',
|
system_lang_code='en'):
|
||||||
loop=None):
|
|
||||||
if not api_id or not api_hash:
|
if not api_id or not api_hash:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Your API ID or Hash cannot be empty or None. "
|
"Your API ID or Hash cannot be empty or None. "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user