From ee9d0e4622fd7f71ab023c0cfc41605920b7a3af Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 3 Mar 2021 18:57:27 +0100 Subject: [PATCH] Add FAQ about client library & framework definitions --- docs/source/faq.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 6b1e26ff..8e681fff 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -59,6 +59,21 @@ Why Pyrogram? .. _TgCrypto: https://github.com/pyrogram/tgcrypto +Why is Pyrogram defined as both Client Library and Framework? +------------------------------------------------------------- + +Simply because it falls in both categories, depending on how you use it. + +Pyrogram as a client library makes it easy and intuitive accessing the Telegram API by offering idiomatic Python code +that is generated or hand-written. Low-level details and client-server communication protocols are handled under the +hood. Pyrogram acts as a client library when *you call* its methods and use its types in a batch application that +executes a set of instructions. + +Pyrogram as a framework makes it easy to handle live events by allowing you to register event handlers that will be +executed as soon as they arrive from the server side. Pyrogram acts as a framework when it's Pyrogram itself that +*calls your code*, that is, your registered event handlers. Such applications are usually started and left online +indefinitely, until you decide to stop them. + How stable and reliable is Pyrogram? ------------------------------------