Module: Bones::RPC::Failover::Disconnect

Extended by:
Disconnect
Included in:
Disconnect
Defined in:
lib/bones/rpc/failover/disconnect.rb

Overview

Disconnect is for the case when we get exceptions we do not know about, and need to disconnect the node to cleanup the problem.

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#execute(exception, node) ⇒ Object

Executes the failover strategy. In the case of disconnect, we just re-raise the exception that was thrown previously extending a socket error and disconnect.

Examples:

Execute the disconnect strategy.

Bones::RPC::Failover::Disconnect.execute(exception, node)

Parameters:

  • exception (Exception)

    The raised exception.

  • node (Node)

    The node the exception got raised on.

Raises:

Since:

  • 2.0.0


26
27
28
29
# File 'lib/bones/rpc/failover/disconnect.rb', line 26

def execute(exception, node)
  node.disconnect
  raise(exception.extend(Errors::SocketError))
end