module Bones::RPC::Failover

Provides behaviour around failover scenarios for different types of exceptions that get raised on connection and execution of operations.

@since 0.0.1

Constants

STRATEGIES

Hash lookup for the failover classes based off the exception type.

@since 0.0.1

Public Instance Methods

get(exception) click to toggle source

Get the appropriate failover handler given the provided exception.

@example Get the failover handler for an IOError.

Bones::RPC::Failover.get(IOError)

@param [ Exception ] exception The raised exception.

@return [ Object ] The failover handler.

@since 0.0.1

# File lib/bones/rpc/failover.rb, line 33
def get(exception)
  STRATEGIES.fetch(exception.class, Disconnect)
end