For the implementation of php queue tasks, consult experts!

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. 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!



Reply to discussion (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.

If you want to use a queue, you can use HTTPSQS

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.
Can you tell me more? What is PHP resident background?

Redis or database has been implemented...

Redis or database has been implemented... how can the database be implemented?

Write mysql or redis directly, and then query SQL.

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

Don't sink your posts !!!

Is it difficult to queue... don't think too complicated...
Use mysql if performance is not emphasized
1. check all the data whose flag bit is 0. if you use php, set the flag bit to 1.
2. use the where flag bit = 0 limit 1 to retrieve the data and set the flag bit of the data to 1.
Redis is simpler, and supports the queue format directly. for details, refer to the redis operation method...

Related Article

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.