phpredispublish-subscribemessagebrokerpaas

is redis pub/sub realistic in php?


I'd like to use redis pub/sub in PHP, but I'm afraid PHP can't be the only tool: a subscriber need to be always callable, since php isn't built for running as a daemon, I can't trust it to reliably be always "on".

So what is the solution for the PHP world?

  1. don't use pub/sub, use other redis' storages with a crontask launching php every x minutes
  2. use a broker which will call php?
  3. other?

With the "2." I mean : use a nodejs/java/fooBar server which is the daemonized subscriber and call back the php (using http/cli or whatever).

I can't find a better idea than the "2." , but it seem so ineffective at the same way...

What is your opinion?


EDIT : How would you do this using a cloud platform like platform.sh which do not give the opportunity to have a supervisor.d alike?


Solution

  • Thanks to the comments, I found a satisfying way to go : use of supervisor.d which will relaunch a symfony Command script with :

    what I can tell from an early point of view :