Class: Neo4j::Core::CypherSession::Adaptors::Bolt
- Defined in:
- lib/neo4j/core/cypher_session/adaptors/bolt.rb
Defined Under Namespace
Constant Summary collapse
- SUPPORTED_VERSIONS =
[1, 0, 0, 0].freeze
- VERSION =
'0.0.1'.freeze
Constants inherited from Base
Neo4j::Core::CypherSession::Adaptors::Base::EMPTY, Neo4j::Core::CypherSession::Adaptors::Base::NEWLINE_W_SPACES, Neo4j::Core::CypherSession::Adaptors::Base::USER_AGENT_STRING
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #connect ⇒ Object
- #connected? ⇒ Boolean
-
#initialize(url, options = {}) ⇒ Bolt
constructor
A new instance of Bolt.
- #query_set(transaction, queries, options = {}) ⇒ Object
- #ssl? ⇒ Boolean
Methods included from Schema
#constraints, #indexes, #version
Methods included from HasUri
#url, #url=, #url_without_password
Methods inherited from Base
#close, #default_subscribe, #logger, #queries, #query, #setup_queries!, #supports_metadata?, #transaction
Methods included from Instrumentable
Constructor Details
#initialize(url, options = {}) ⇒ Bolt
Returns a new instance of Bolt.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 25 def initialize(url, = {}) self.url = url @options = @net_tcp_client_options = {read_timeout: .fetch(:read_timeout, -1), write_timeout: .fetch(:write_timeout, -1), connect_timeout: .fetch(:connect_timeout, 10), ssl: .fetch(:ssl, {})} open_socket end |
Class Method Details
.transaction_class ⇒ Object
62 63 64 65 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 62 def self.transaction_class require 'neo4j/core/cypher_session/transactions/bolt' Neo4j::Core::CypherSession::Transactions::Bolt end |
Instance Method Details
#connect ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 36 def connect handshake init = [0] return if .type == :success data = .args[0] fail "Init did not complete successfully\n\n#{data['code']}\n#{data['message']}" end |
#connected? ⇒ Boolean
58 59 60 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 58 def connected? !!@tcp_client && !@tcp_client.closed? end |
#query_set(transaction, queries, options = {}) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 48 def query_set(transaction, queries, = {}) setup_queries!(queries, transaction, skip_instrumentation: [:skip_instrumentation]) self.class.instrument_request(self) do send_query_jobs(queries) build_response(queries, [:wrap_level] || @options[:wrap_level]) end end |
#ssl? ⇒ Boolean
75 76 77 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 75 def ssl? @tcp_client.socket.is_a?(OpenSSL::SSL::SSLSocket) end |