Please give me some ideas on how to implement task queue with PHP+Redis

WBOY
Release: 2016-10-19 10:18:56
Original
1045 people have browsed it

My PHP website program calls the interface of an external website.
When the user inputs data, the PHP program will receive the data, then request the interface of the external website based on the data, obtain the data and return it to the user.
But when multiple users submit data at the same time, PHP will request that interface at the same time, and that interface will return an error.

Now I want to use PHP+Redis to make a queue. The user's request will be placed in the Redis queue and the external interfaces will be queried one by one to avoid the problem of requesting interfaces at the same time.

How to implement it specifically?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template