Search code examples
phpwebsocketratchet

PHP WebSocket Daemon


I have set up a WebSocket server in php using Ratchet running as a daemon - exposed by Varnish cache.

However there is a big problem i see in it - the lack of threads in php. Is there anything i can do to pass on data for processing without hanging the whole server? Is it possible in PHP or should i just move to a different technology - node.js for example - but seeing as the main project is in PHP it would be complicated to make that work together. If any option to do this in PHP is available id prefer it.


Solution

  • https://github.com/krakjoe/pthreads is a library I've heard mentioned a lot (but haven't personally used). Enjoy!