Questions about the implementation of the PHP queue task
Source: Internet
Author: User
PHP Queue Task Implementation of the problem to ask a master!
To do a broadcast function, the broadcast has a start time, an end time, a time interval, and a priority. As the following table:
To implement this feature: After creating a new broadcast, judge the start time, join the broadcast to the queue, and use a timer to perform the broadcasts in the queue.
1 How do I put the data into the queue?
2 How do I fetch data from a queue?
3 How can I determine the broadcast order based on priority, such as 1, 2, and 3?
4 How do I invoke an asynchronous call to execute all broadcasts with just one do?
5 How can I replace a broadcast that already exists in the queue after the broadcast is modified?
The Big Fairy help you!
------Solution--------------------
You said the demand, did not see the need to use the queue, and the lily, there is priority with what queue ah, can be used in the background of PHP processing. Use MySQL on the line.
------Solution--------------------
If you want to use a queue, you can use HTTPSQS
------Solution--------------------
Redis or database is well-implemented ...
------Solution--------------------
Write MySQL or Redis directly, and then SQL queries will do.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.