Php queue task implementation problems

Source: Internet
Author: User
For the implementation of php queue tasks, consult experts! To implement a broadcast function, broadcast has the start time, end time, Interval time, and priority. The following table shows how to implement this function: After creating a broadcast, determine the start time, add the broadcast to the queue, and use a timer to execute various broadcasts in the queue. 1 & nbsp; how to put data in the queue? 2 & nbsp; how to retrieve data in the queue? 3 & nbsp; how to determine the playing sequence of broadcast based on priority, such as 1, 2, and 3? 4 & learn how to implement nbs php queue tasks!
To implement a broadcast function, broadcast has the start time, end time, Interval time, and priority. See the following table:


To implement this function, create a broadcast, determine the start time, add the broadcast to the queue, and use a timer to execute the broadcast in the queue.

1. how to put data in the queue?
2. how do I retrieve data from the queue?
3. how can I determine the playing sequence of a broadcast based on the priority, such as 1, 2, and 3?
4. how does one Asynchronous call execute only one do while to execute all broadcasts?
5. after modifying the broadcast, how can I replace the existing broadcast in the drop-down column?

Thank you!



------ Solution --------------------
The requirement you mentioned does not show that there is a need to use a queue, and it is superfluous. what queue is the priority? you can use php to process it in the background. Use mysql.
------ Solution --------------------
If you want to use a queue, you can use HTTPSQS
------ Solution --------------------
Redis or database has been implemented...
------ Solution --------------------
Write mysql or redis directly, and then query SQL.

What is a queue, first-in-first-out

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.