I’m making a telegram bot, counting on traffic of about 100 users daily. Faced with the problem of the architecture of the bot design. By itself, does the telegram bot process each user’s requests in turn? Then do I need a queue of tasks of the “Redis” type?
I’m making a telegram bot, counting on traffic of about 100 users daily. Faced with the problem of the architecture of the bot design. By itself, does the telegram bot process each user’s requests in turn? Then do I need a queue of tasks of the “Redis” type?
I created a queue using Redis and add to it any tasks that the user calls using commands:
job = queue.enqueue(generate_key, chat_id)
while True:
if job.is_finished:
job_result = job.result
await asyncio.sleep(1)
I also tried using my bot without queuing and didn’t notice any difference. My friend and I tried to call commands at the same time, and the bot with and without a queue handles the first task of calling the command faster.
EgasVegas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.