How does mysql-php queue plan tasks? Is ignore_user_abort used?

Source: Internet
Author: User
Last time I asked a question about the php queue usage scenario and implementation, but no one answered the result. Now I see that there is such a function ignore_user_abort which is implemented in this way? Is there a problem if the script keeps dropping? In traditional cases, the backend PHP script is still in... I last asked a question about the use scenario and implementation of the php queue, but no one answered the result. Now I see another function. ignore_user_abortLink

Is php queue implemented in this way? Is there a problem if the script keeps dropping?

In traditional cases, when the backend PHP script is still running, will the user suddenly close the browser, resulting in php Execution halfway? For example, multiple postssqlIf the statement is to be executed, will the client user suddenly close the browser and disconnect the connection?

Hope you can help me answer this question. Thank you!

Reply content:

The last time I asked a question about the use scenario and implementation of the php queue, no one answered the result, and now I see a function like this.ignore_user_abortLink

Is php queue implemented in this way? Is there a problem if the script keeps dropping?

In traditional cases, when the backend PHP script is still running, will the user suddenly close the browser, resulting in php Execution halfway? For example, multiple postssqlIf the statement is to be executed, will the client user suddenly close the browser and disconnect the connection?

Hope you can help me answer this question. Thank you!

What is your need?
The scheduled tasks in the queue have no relationship with the ignore_user_abort function.
If you want to have a resident php process to handle a job, you can write a script whiel (true) to keep running on the console.
You can also create a crontab scheduled task at intervals of time (for example, execute every second, and the effect is not much different from that of the resident script ).

In this case, professional queue services are a good choice, such as rabbitmq and beanstalkd. You can also store asynchronous tasks in the database, and then write a resident script to monitor the table to execute new tasks.

I don't know what the subject wants to ask. If I want to schedule a task, as stated on the first floor, I just need to use crontab and cli to execute PHP. Ignore_user_abort is only used to ignore browser interruptions.

Who stepped on me? Why did you step on me!

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.