How to Build a PHP Queue System

后端 未结 1 1067
我在风中等你
我在风中等你 2020-12-23 15:22

I had to build a PHP Queue System, and found this brilliant article http://squirrelshaterobots.com/programming/php/building-a-queue-server-in-php-part-1-understand

相关标签:
1条回答
  • 2020-12-23 16:20

    My question is "How do i get the job to start automatically when/if the server has to restart?"

    By adding it to the list of things started when the server starts. Unfortunately the instructions for doing so vary wildly by operating system and OS version. You probably want to use something slightly more cross-platform. I've had a great deal of luck with supervisor, which you can probably find in the package repos on your OS of choice.

    That said, you are going down the route of madness. The thing you're doing has been done before, better, by awesome people. Check out the Gearman work queue system and the accompnaying PECL extension. It happens that supervisor is pretty handy for keeping your Gearman workers alive as well.

    0 讨论(0)
提交回复
热议问题