colinmollenhour / credis

Lightweight PHP Redis client that can run standalone or wrap phpredis.
MIT License
365 stars 144 forks source link

Please review the following commit #16

Closed ThijsFeryn closed 7 years ago

ThijsFeryn commented 10 years ago

Hi Colin

I submitted a pull request on Cm_Cache_Backend_Redis some time ago. It featured multi-server support, but it was declined because Credis needed some work.

I believe I did some of the work. It surely ain't perfect yet, but it's a start. Please review the following commit: https://github.com/ThijsFeryn/credis/commit/ff3c52482a923a7a44783b5c99ab3b886e6c2412

This separate branch has full Sentinel support and built-in read/write splitting for Credis_Cluster. The Sentinel class uses Credis_Cluster to abstract the read and write nodes.

I'd appreciate your feedback, which I will use to update this until it's ready for a pull request. If you want to test it, just run examples/start.sh and then run test.php. The Sentinel is configured to do an autofailover after 5 seconds.

Bear in mind that Sentinel actually overwrites Redis configs.

Hope you like it. I'm very much willing to make this work and once Credis is up to a certain level of quality, I can start including these clustering features in Cm_Cache_Backend_Redis.

Cheers Thijs

Xon commented 7 years ago

Merged ages ago in https://github.com/colinmollenhour/credis/pull/17