K
K
Kirill2020-02-23 18:12:04
Python
Kirill, 2020-02-23 18:12:04

How to make multithreading in VK bot?

There is an almost ready-made bot for the VK community. Its task is to take orders from people, enter them into the mysql database and then issue them to administrators as they are completed. The process of ordering and processing it takes time, in which other people should be able to interact with the bot.
I read in other questions about asyncio, but I didn’t really understand anything. I saw examples with several tokens somewhere.
After the order, he gets into the queue. It is necessary for me that during the order by one user, another user could also actively work. Because during the first order, the bot will wait for a response from a specific user.
In general, I need help on how to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2020-02-23
@kustiktm_kirill

After saving the order to the database, complete the interaction with the user. Hang the execution of orders on another process, cron task, etc. And then issue it to administrators.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question