Closed Jasim9 closed 8 years ago
That's all controlled by twisted.internet.protocol.ReconnectingClientFactory. There's an exponential back off for retries.
Is there a way to expose the resetDelay
function from ReconnectingClientFactory
in txyam so that we can control the delay between retries within the application?
Each of your client's factories (in the factories
property) is an instance of MemCacheClientFactory
which extends ReconnectingClientFactory
. This means that you can do something like:
for factory in client.factories:
factory.resetDelay()
though I'm not sure why that's necessary. Why do you need to reset the delay?
It can be useful for implementing a custom timeout if we don't want to use exponential back off. I want a constant timeout of 60 seconds for example, so every 60 seconds I can invoke the resetDelay()
and the client will try to reconnect.
I want to know what dead_timeout does the client use by default and is there a way to pass it as a parameter? I was checking the failover and when I bring a failed server backup, I think it takes quite a while for YamClient to start bringing stats from that server.