Asyncio, aiogoogle, google drive... Help! #2344
-
Hi, I would like some advice to solve this problem. I am developing a bot with this framework. In a function, which the user can invoke via command, an asynchronous function is called to download some parallel files from google drive. (Through asyncio and https://aiogoogle.readthedocs.io/). I would like to know how to make it work in a multi-user context. def functionCommandStart(update:Update,context:CallbackContext): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Mind, the number of parallel updates the dispatcher will be able to run concurrently is limited to the number of workers you tell the |
Beta Was this translation helpful? Give feedback.
Handler
classes offer an option to make their callback functions run asynchronously, in their own thread:Handler(callback, run_async=True)
. The wiki has a pretty nice section about making the dispatcher run some handlers callbacks asynchronously.Mind, the number of parallel updates the dispatcher will be able to run concurrently is limited to the number of workers you tell the
Dispatcher
to initialize (docs). You can set it while initializing yourUpdater
object:Updater(token="", workers=16)