I would be happy if my phpredis can work like this:
1. connect (maybe remotely) to redis server with timeout = 0 (no timeout occurs)
2. subscribe to a redis channel
3. When connect is broken, throw an exception
4. Get the exception, make some logs, notifications and may re-connect.
This is likely one of the way that I can use the redis as a message queue with this feature, and I am wondering is there any way the phppredis can work like this?
Interesting. Is the problem now that if the connection is broken you don't get any messages? I will have to test that sort of process to see what I can come up with.
In my limited test, it is. When I break the connection manually, there is no exception, no any error message. It is even the worse that in my test I totally lose the control of the original processes. They just become isolated and I have to kill them by process id.
The code for connection:
protected static $_default_config = array(
'host' => '192.168.1.80',
'password' => NULL,
'port' => 6379,
'timeout' => 0