Skip to content

Commit ee9d0e4

Browse files
committed
Add FAQ about client library & framework definitions
1 parent 52e905d commit ee9d0e4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/source/faq.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ Why Pyrogram?
5959

6060
.. _TgCrypto: https://github.com/pyrogram/tgcrypto
6161

62+
Why is Pyrogram defined as both Client Library and Framework?
63+
-------------------------------------------------------------
64+
65+
Simply because it falls in both categories, depending on how you use it.
66+
67+
Pyrogram as a client library makes it easy and intuitive accessing the Telegram API by offering idiomatic Python code
68+
that is generated or hand-written. Low-level details and client-server communication protocols are handled under the
69+
hood. Pyrogram acts as a client library when *you call* its methods and use its types in a batch application that
70+
executes a set of instructions.
71+
72+
Pyrogram as a framework makes it easy to handle live events by allowing you to register event handlers that will be
73+
executed as soon as they arrive from the server side. Pyrogram acts as a framework when it's Pyrogram itself that
74+
*calls your code*, that is, your registered event handlers. Such applications are usually started and left online
75+
indefinitely, until you decide to stop them.
76+
6277
How stable and reliable is Pyrogram?
6378
------------------------------------
6479

0 commit comments

Comments
 (0)