mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Improvements to the documentation
This commit is contained in:
parent
bf8a334e32
commit
5f6788ad69
@ -310,7 +310,7 @@ def pyrogram_api():
|
|||||||
""",
|
""",
|
||||||
advanced="""
|
advanced="""
|
||||||
Advanced
|
Advanced
|
||||||
send
|
invoke
|
||||||
resolve_peer
|
resolve_peer
|
||||||
save_file
|
save_file
|
||||||
"""
|
"""
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
socket.send() raised exception, OSError(), TimeoutError()
|
socket.send() raised exception, OSError(), TimeoutError()
|
||||||
=========================================================
|
=========================================================
|
||||||
|
|
||||||
If you get this error chances are you are blocking the event loop for too long.
|
If you get this error chances are you are blocking the event loop for too long, most likely due to an improper use of
|
||||||
In general, it means you are executing thread-blocking code that prevents the event loop from
|
non-asynchronous or threaded operations which may lead to blocking code that prevents the event loop from running
|
||||||
running properly. For example:
|
properly.
|
||||||
|
|
||||||
- You are using ``time.sleep()`` instead of ``asyncio.sleep()``.
|
You can consider the following:
|
||||||
- You are running processing loops that take too much time to complete.
|
|
||||||
- You are reading/writing files to disk that take too much time to complete.
|
- Use Pyrogram asynchronously in its intended way.
|
||||||
|
- Use shorter non-asynchronous processing loops.
|
||||||
|
- Use ``asyncio.sleep()`` instead of ``time.sleep()``.
|
||||||
|
@ -38,7 +38,7 @@ live in their respective packages (and sub-packages): ``pyrogram.raw.functions``
|
|||||||
as Python classes, meaning you need to create an instance of each every time you need them and fill them in with the
|
as Python classes, meaning you need to create an instance of each every time you need them and fill them in with the
|
||||||
correct values using named arguments.
|
correct values using named arguments.
|
||||||
|
|
||||||
Next, to actually invoke the raw function you have to use the :meth:`~pyrogram.Client.send` method provided by the
|
Next, to actually invoke the raw function you have to use the :meth:`~pyrogram.Client.invoke` method provided by the
|
||||||
Client class and pass the function object you created.
|
Client class and pass the function object you created.
|
||||||
|
|
||||||
Here's some examples:
|
Here's some examples:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user