Pytdbot 0.9.6.dev0__tar.gz → 0.9.6.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/PKG-INFO +1 -1
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/Pytdbot.egg-info/PKG-INFO +1 -1
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/__init__.py +1 -1
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/client.py +40 -3
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/LICENSE +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/MANIFEST.in +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/Pytdbot.egg-info/SOURCES.txt +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/Pytdbot.egg-info/dependency_links.txt +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/Pytdbot.egg-info/requires.txt +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/Pytdbot.egg-info/top_level.txt +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/README.md +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/client_manager.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/exception/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/filters.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/handlers/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/handlers/decorators.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/handlers/handler.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/handlers/td_updates.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/methods/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/methods/methods.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/methods/td_functions.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/tdjson/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/tdjson/tdjson.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/plugins/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/callback_query.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/chatActions.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/file.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/message.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/types.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/tdserver/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/tdserver/schedule.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/tdserver/stats.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/__init__.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/asyncio_utils.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/escape.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/json_utils.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/obj_encoder.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/strings.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/text_format.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/utils/webapps.py +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/requirements.txt +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/setup.cfg +0 -0
- {pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/setup.py +0 -0
|
@@ -94,6 +94,9 @@ class Client(Decorators, Methods):
|
|
|
94
94
|
workers (``int``, *optional*):
|
|
95
95
|
Number of workers to handle updates. Default is ``5``. If set to ``None``, updates will be immediately handled instead of being queued, which can impact performance.
|
|
96
96
|
|
|
97
|
+
handlers_timeout (``float``, *optional*):
|
|
98
|
+
Timeout for handlers. If set, each handler will be awaited with this timeout. Default is ``None`` (no timeout)
|
|
99
|
+
|
|
97
100
|
no_updates (``bool``, *optional*):
|
|
98
101
|
Whether the client should handle updates or not. Applicable only when using [TDLib Server](https://github.com/pytdbot/tdlib-server). Default is ``False``
|
|
99
102
|
|
|
@@ -128,6 +131,7 @@ class Client(Decorators, Methods):
|
|
|
128
131
|
loop: asyncio.AbstractEventLoop = None,
|
|
129
132
|
options: dict = None,
|
|
130
133
|
workers: int = 5,
|
|
134
|
+
handlers_timeout: float = None,
|
|
131
135
|
no_updates: bool = False,
|
|
132
136
|
load_messages_before_reply: bool = False,
|
|
133
137
|
td_verbosity: int = 2,
|
|
@@ -159,6 +163,7 @@ class Client(Decorators, Methods):
|
|
|
159
163
|
self.use_message_database = use_message_database
|
|
160
164
|
self.td_options = options
|
|
161
165
|
self.workers = workers
|
|
166
|
+
self.handlers_timeout = handlers_timeout
|
|
162
167
|
self.no_updates = no_updates
|
|
163
168
|
self.load_messages_before_reply = load_messages_before_reply
|
|
164
169
|
self.queue = asyncio.Queue()
|
|
@@ -820,7 +825,18 @@ class Client(Decorators, Methods):
|
|
|
820
825
|
elif not filter_function(self, handler_value):
|
|
821
826
|
continue
|
|
822
827
|
|
|
823
|
-
|
|
828
|
+
if self.handlers_timeout is None:
|
|
829
|
+
await initializer(self, handler_value)
|
|
830
|
+
else:
|
|
831
|
+
try:
|
|
832
|
+
await asyncio.wait_for(
|
|
833
|
+
initializer(self, handler_value),
|
|
834
|
+
timeout=self.handlers_timeout,
|
|
835
|
+
)
|
|
836
|
+
except asyncio.TimeoutError:
|
|
837
|
+
self.logger.warning(
|
|
838
|
+
f"Initializer {initializer} timed out after {self.handlers_timeout} seconds"
|
|
839
|
+
)
|
|
824
840
|
except StopHandlers as e:
|
|
825
841
|
raise e
|
|
826
842
|
except Exception:
|
|
@@ -841,7 +857,17 @@ class Client(Decorators, Methods):
|
|
|
841
857
|
elif not filter_function(self, handler_value):
|
|
842
858
|
continue
|
|
843
859
|
|
|
844
|
-
|
|
860
|
+
if self.handlers_timeout is None:
|
|
861
|
+
await handler(self, handler_value)
|
|
862
|
+
else:
|
|
863
|
+
try:
|
|
864
|
+
await asyncio.wait_for(
|
|
865
|
+
handler(self, handler_value), timeout=self.handlers_timeout
|
|
866
|
+
)
|
|
867
|
+
except asyncio.TimeoutError:
|
|
868
|
+
self.logger.warning(
|
|
869
|
+
f"Handler {handler} timed out after {self.handlers_timeout} seconds"
|
|
870
|
+
)
|
|
845
871
|
except StopHandlers as e:
|
|
846
872
|
raise e
|
|
847
873
|
except Exception:
|
|
@@ -863,7 +889,18 @@ class Client(Decorators, Methods):
|
|
|
863
889
|
elif not filter_function(self, handler_value):
|
|
864
890
|
continue
|
|
865
891
|
|
|
866
|
-
|
|
892
|
+
if self.handlers_timeout is None:
|
|
893
|
+
await finalizer(self, handler_value)
|
|
894
|
+
else:
|
|
895
|
+
try:
|
|
896
|
+
await asyncio.wait_for(
|
|
897
|
+
finalizer(self, handler_value),
|
|
898
|
+
timeout=self.handlers_timeout,
|
|
899
|
+
)
|
|
900
|
+
except asyncio.TimeoutError:
|
|
901
|
+
self.logger.warning(
|
|
902
|
+
f"Finalizer {finalizer} timed out after {self.handlers_timeout} seconds"
|
|
903
|
+
)
|
|
867
904
|
except StopHandlers as e:
|
|
868
905
|
raise e
|
|
869
906
|
except Exception:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/callback_query.py
RENAMED
|
File without changes
|
{pytdbot-0.9.6.dev0 → pytdbot-0.9.6.dev1}/pytdbot/types/td_types/bound_methods/chatActions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|