From 4e61bc3a8b3b4ee8cbd3365c59f826c5dc9d5ba3 Mon Sep 17 00:00:00 2001 From: vixfwis Date: Thu, 17 Dec 2020 15:34:36 +0300 Subject: [PATCH] add short description to example and readme files --- examples/webhook_examples/README.md | 13 +++++++++++-- .../webhook_examples/webhook_twisted_echo_bot.py | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) mode change 100755 => 100644 examples/webhook_examples/webhook_twisted_echo_bot.py diff --git a/examples/webhook_examples/README.md b/examples/webhook_examples/README.md index b1e4351..686a38b 100644 --- a/examples/webhook_examples/README.md +++ b/examples/webhook_examples/README.md @@ -1,6 +1,6 @@ # Webhook examples using pyTelegramBotAPI -There are 4 examples in this directory using different libraries: +There are 5 examples in this directory using different libraries: * **Python (CPython):** *webhook_cpython_echo_bot.py* * **Pros:** @@ -42,4 +42,13 @@ There are 4 examples in this directory using different libraries: * **Cons:** * Requires Python 3.4.2+, don't work with Python 2 -*Latest update of this document: 2017-01-30* +* **Twisted (20.3.0):** *webhook_twisted_echo_bot.py* + * **Pros:** + * Asynchronous event-driven networking engine + * Very high performance + * Built-in support for many internet protocols + * **Cons:** + * Twisted is low-level, which may be good or bad depending on use case + * Considerable learning curve - reading docs is a must. + +*Latest update of this document: 2020-12-17* diff --git a/examples/webhook_examples/webhook_twisted_echo_bot.py b/examples/webhook_examples/webhook_twisted_echo_bot.py old mode 100755 new mode 100644 index 6db5893..9a15190 --- a/examples/webhook_examples/webhook_twisted_echo_bot.py +++ b/examples/webhook_examples/webhook_twisted_echo_bot.py @@ -1,6 +1,12 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# This is an example echo bot using webhook with Twisted network framework. +# Updates are received with Twisted web server and processed in reactor thread pool. +# Relevant docs: +# https://twistedmatrix.com/documents/current/core/howto/reactor-basics.html +# https://twistedmatrix.com/documents/current/web/howto/using-twistedweb.html + import logging import telebot import json