# File lib/moped/read_preference/nearest.rb, line 43 def with_node(cluster, &block) with_retry(cluster) do nearest = cluster.nodes.sort_by(&:latency).first if nearest block.call(nearest) else raise Errors::ConnectionFailure, "No nodes available to select in the cluster" end end end