Close connection in PHP but keep executing script

后端 未结 5 1625
孤独总比滥情好
孤独总比滥情好 2021-01-14 00:10

Anyone know how to close the connection (besides just flush()?), but keep executing some code afterwards.

I don\'t want the client to see the long proce

5条回答
  •  感动是毒
    2021-01-14 00:50

    We solved this issue by inserting the work that needs to be done into a job queue, and then have a cron-script pick up the backend jobs regularly. Probably not exactly what you need, but it works very well for data-intensive processes.

    (you could also use Zend Server's job queue, if you've got a wad of cash and want a tried-and-tested solution)

提交回复
热议问题