Closed Aerendir closed 6 years ago
Hi @Aerendir,
Unfortunately, PHP is not very well suited to handle persistent connections. Projects like React PHP or RoadRunner may allow to implement a proper hub, but they will be less efficient than Go (or Rust, or C) anyway. PHP FPM and mod_php are definitely not adapted.
Also, the Go hub (and, actually, the protocol itself) has been designed from the ground to be very easy to use from PHP, or from serverless architectures. For instance, here is how it looks to integrate the Go hub (or any other hub implementation) with Symfony: https://github.com/symfony/symfony/pull/28877
As the hub is a standalone component, I'm not sure that the language it is written in matter (developers don't have to deal with its code directly, everything pass through its web API).
That being said, I would be very happy to help if someone want to implement a hub in pure PHP.
Ok, thank you for your very clear explanations.
I've seen the PR you linked: that was my starting point to discover Mercure! :)
I'll give it a try (maybe I have a use case), but first I need to better understand where to host the hub (probably I will use the Docker image)... Not something I will do in next days, unfortunately. But something I will do for sure...
In the meantime, thank you again for your answer!
I've read the specification and it seems really promising.
I don't know Go, so I'd like to know if a PHP version is planned or not.
Thank you!