Class: Giraph::Remote::Connector

Inherits:
Object
  • Object
show all
Defined in:
lib/giraph/remote/connector.rb

Overview

sends the reconstructed subquery request and parses the response.

Instance Method Summary collapse

Constructor Details

#initialize(endpoint) ⇒ Connector

Returns a new instance of Connector.



7
8
9
# File 'lib/giraph/remote/connector.rb', line 7

def initialize(endpoint)
  @endpoint = endpoint
end

Instance Method Details

#resolve(context, query_string, query_variables) ⇒ Object

The resolver method for the connection field.



12
13
14
15
16
17
18
19
20
# File 'lib/giraph/remote/connector.rb', line 12

def resolve(context, query_string, query_variables)
  # Remote can return data, error or totally freak out,
  # we handle all here, and note anything of relevance
  result = run_query(query_string, query_variables)
  return_data_or_raise(result) do |exception|
    # Tack on details for host's version of the query
    exception.ast_node = context.ast_node
  end
end