From 56bfddab2e8996f7a526dd583cc98a7ebee68ee9 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 20 Jun 2023 21:22:46 +0530 Subject: [PATCH] improve --- Concurrency.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Concurrency.md b/Concurrency.md index e8e761b..65b2431 100644 --- a/Concurrency.md +++ b/Concurrency.md @@ -101,6 +101,7 @@ while not application.update_queue.empty(): update = await application.update_queue.get() asyncio.create_task(application.process_update(update)) ``` +This setting is *independent* of the `block` parameter of `Handler` and within `application.process_update` concurrency still works as explained above. You can also implement your own custom update processor by subclassing the `BaseUpdateProcessor` class: ```python @@ -119,11 +120,9 @@ class MyUpdateProcessor(BaseUpdateProcessor): Application.builder().token('TOKEN').concurrent_updates(MyUpdateProcessor(10)).build() ``` -The above code processes every callback_query update with a delay of 5 seconds for up to 10 updates simultaneously. This is just an example of how to use the `BaseUpdateProcessor` class, there are endless possibilities to this. +The above code processes every `callback_query` update with a delay of 5 seconds for up to 10 updates simultaneously. This is just an example of how to use the `BaseUpdateProcessor` class, there are endless possibilities to this. See the [documentation](https://python-telegram-bot.readthedocs.io/en/latest/telegram.ext.baseupdateprocessor.html#telegram.ext.BaseUpdateProcessor) for more information. -This setting is *independent* of the `block` parameter of `Handler` and within `application.process_update` concurrency still works as explained above. - **Note:** The number of concurrently processed updates is limited (the limit defaults to 4096 updates at a time). This is a simple measure to avoid e.g. DDOS attacks