IlyaSkriblovsky / txredisapi

non-blocking redis client for python twisted
Apache License 2.0
235 stars 91 forks source link

Redis Sentinel support #110

Closed IlyaSkriblovsky closed 7 years ago

IlyaSkriblovsky commented 7 years ago

This patch adds support for service discovery and automatic failover using Redis Sentinel.

Sentinel.master_for() and Sentinel.slave_for() create a connection pool that hits Sentinel for an IP address every time it is going to connect to Redis.

I am already using it in production for about 5 months and it looks reliable enough on failing over when master node is going down.

Code review would be welcomed!

IlyaSkriblovsky commented 7 years ago

Since there is no feedback, seems I need to take courage and merge this by myself ;)

fiorix commented 7 years ago

Hey @IlyaSkriblovsky, my apologies for not being responsive in a timely manner here. I glanced through the diff and it looks alright. This is much appreciated, you rock. 👍