Answer the question
In order to leave comments, you need to log in
How to organize the execution of a script with a search algorithm in the background (using the VK API and Yii2)?
Good day!
I am developing an algorithm for searching users of certain communities using the VK API. Of course, the execution time of the script depends on the specified parameters, the number of groups, etc. And it ends up being pretty big. Therefore, it was decided to implement and provide the user with the search results for the most popular group. And then, from the transition from page to page with the results, I use pagination, "somehow" to search for the rest of the groups.
Please advise how exactly this process can be implemented? As I understand it, this needs to be done somehow in the background and combine new data with the previous ones (for example, using a cache or session).
Thanks in advance to everyone for help!
Answer the question
In order to leave comments, you need to log in
Use the Task Queue
You receive a request from the user, send it to the task queue, the task is processed in the background, after processing the result is stored in the storage (mysql, redis, mongo). And you notify the user that the report is generated, display the result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question