The project currently has the following requirement: the system regularly accesses some websites and returns results (the websites to be accessed are saved in MySQL ), I want to use Redis to implement the queue + Linux scheduled task, but I have no experience in this aspect. Redis and Linux only have a little knowledge. Please... the project currently has the following requirement: the system regularly accesses some websites and returns results (the websites to be accessed are saved in MySQL ), I want to use Redis to implement the queue + Linux scheduled task, but I have no experience in this aspect. Redis and Linux only have a little knowledge. Please share your thoughts and brainstorm.
Reply content:
The project currently has the following requirement: the system regularly accesses some websites and returns results (the websites to be accessed are saved in MySQL ), I want to use Redis to implement the queue + Linux scheduled task, but I have no experience in this aspect. Redis and Linux only have a little knowledge. Please share your thoughts and brainstorm.
First in queue$ Redis-> lpush ('test: queue ', $ json)// $ Json is the parameter to be processed
Set a scheduled task in crontab. The program is probably
While ($ job = $ redis-> rPop ('test: queue ') {var_dump ($ job); // parse $ job processing}
Crontab can be executed once every minute. It may be too slow to process queues.