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_abort
Link
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 postssql
If 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_abort
Link
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 postssql
If 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!