3 ms·
PHP simply is not suited for long lived processes. If you only want the ability to push something to clients without polling, then maybe you could set up someth
by the_gipsy 14y ago
PHP simply is not suited for long lived processes. If you only want the ability to push something to clients without polling, then maybe you could set up something very simple with python, and communicate over redis or some other MQ.
- 0x0 14y agoWhat makes you say that? I've been running several PHP processes for weeks at a time with no problems, feeding on busy TCP connections for the whole time.
- the_gipsy 14y agoI didn't say that you can't do it.
- 0x0 14y agoBut why do you find it unsuitable?
- Shorel 14y agoIt has ugly syntax and bad standard function names, and some people code ugly things with it. /sarcasm
- the_gipsy 14y agoIt is build around a model of process input, spit output, exit; which is not what you want for long living processes. There are many articles about it's flaws, my favourite is this one: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- elliotanderson 14y agoA few years ago I would have agreed, but I have several PHP daemons consuming messages from RabbitMQ and their uptime is in the range of months. Throw a little supervisord into the mix to keep an eye on things and you'd be surprised how far it has come.