Class: Kestrel::Client::Retrying

Inherits:
Proxy
  • Object
show all
Defined in:
lib/kestrel/client/retrying.rb

Constant Summary collapse

DEFAULT_RETRY_COUNT =

Number of times to retry after connection failures

5
RECOVERABLE_ERRORS =

Exceptions which are connection failures we retry after

[
 Memcached::ServerIsMarkedDead,
 Memcached::ATimeoutOccurred,
 Memcached::ConnectionBindFailure,
 Memcached::ConnectionFailure,
 Memcached::ConnectionSocketCreateFailure,
 Memcached::Failure,
 Memcached::MemoryAllocationFailure,
 Memcached::ReadFailure,
 Memcached::ServerError,
 Memcached::SystemError,
 Memcached::UnknownReadFailure,
 Memcached::WriteFailure
]

Instance Attribute Summary

Attributes inherited from Proxy

#client

Instance Method Summary collapse

Methods inherited from Proxy

#method_missing

Constructor Details

#initialize(client, retry_count = nil) ⇒ Retrying

Returns a new instance of Retrying.



24
25
26
27
# File 'lib/kestrel/client/retrying.rb', line 24

def initialize(client, retry_count = nil)
  @retry_count = retry_count || DEFAULT_RETRY_COUNT
  super(client)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kestrel::Client::Proxy