Skip to content

Instantly share code, notes, and snippets.

@williamsjj
Created July 28, 2010 20:01
Show Gist options
  • Select an option

  • Save williamsjj/496049 to your computer and use it in GitHub Desktop.

Select an option

Save williamsjj/496049 to your computer and use it in GitHub Desktop.
class RedisClientFactory(protocol.ReconnectingClientFactory):
"""Redis client factory that reconnects/creates a new connection when the old one is lost."""
maxRetries = 3
def buildProtocol(self, addr):
self.client = Redis()
self.client.factory = self
self.resetDelay()
return self.client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment