Module: Thrifter::Retry

Defined in:
lib/thrifter/extensions/retriable.rb

Defined Under Namespace

Classes: Proxy

Constant Summary collapse

DEFAULT_RETRIABLE_ERRORS =
[
  ClientError,
  Thrift::TransportException,
  Thrift::ProtocolException,
  Thrift::ApplicationException,
  Timeout::Error,
  Errno::ECONNREFUSED,
  Errno::EADDRNOTAVAIL,
  Errno::EHOSTUNREACH,
  Errno::EHOSTDOWN,
  Errno::ETIMEDOUT
]

Instance Method Summary collapse

Instance Method Details

#with_retry(tries: 5, interval: 0.01, retriable: [ ]) {|proxy| ... } ⇒ Object

Yields:

  • (proxy)


55
56
57
58
59
# File 'lib/thrifter/extensions/retriable.rb', line 55

def with_retry(tries: 5, interval: 0.01, retriable: [ ])
  proxy = Proxy.new self, tries, interval, retriable
  yield proxy if block_given?
  proxy
end