Method: Moped::Operation::Read#execute

Defined in:
lib/moped/operation/read.rb

#execute(node) ⇒ Protocol::Reply

Execute the read operation on the provided node. If the query failed, we will check if the failure was due to authorization and attempt the operation again. This could sometimes happen in the case of a step down or reconfiguration on the server side.

Examples:

Execute the operation.

read.execute(node)

Parameters:

  • node (Node)

    The node to execute the read on.

Returns:

Raises:

  • (Failure)

    If the read operation failed.

Since:

  • 2.0.0



47
48
49
50
51
52
53
54
# File 'lib/moped/operation/read.rb', line 47

def execute(node)
  node.process(operation) do |reply|
    if operation.failure?(reply)
      raise operation.failure_exception(reply)
    end
    operation.results(reply)
  end
end