You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm stuck with an issue where onRandom() is not being called until the previous call returns. So, if multiple users are using the bot, they have to wait and queue up to get the response.
Is that expected behaviour? What am I doing wrong here?
Hello, I'm not 100% sure about that, however I think this is normal and expected behaviour. I'm also new to telegram bots, so I've just reproduced your code, and then started googling, and it seems to me that parallel handling of some commands can be accomplished via async code only. Look at https://grammy.dev/advanced/scaling.html which I find usefull for understanding.
In you code, if you want to handle requests in parallel, you should not await new Promise, but rather resolve it as follows:
Hi,I've been following documentation to setup the simplest possible bot as an experiment.
And in app.module
I'm stuck with an issue where
onRandom()
is not being called until the previous call returns. So, if multiple users are using the bot, they have to wait and queue up to get the response.Is that expected behaviour? What am I doing wrong here?
Versions:
The text was updated successfully, but these errors were encountered: