Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Typhoeus to help forked/threaded users #272

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/neo4j-server/cypher_session.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'uri'
require 'typhoeus/adapters/faraday'

module Neo4j
module Server
Expand Down Expand Up @@ -31,7 +32,7 @@ def self.create_connection(params, url = nil)

b.response :multi_json, symbolize_keys: true, content_type: 'application/json'
# b.use Faraday::Response::RaiseError
b.use Faraday::Adapter::NetHttpPersistent
b.use Faraday::Adapter::Typhoeus
# b.adapter Faraday.default_adapter
end
conn.headers = {'Content-Type' => 'application/json', 'User-Agent' => ::Neo4j::Session.user_agent_string}
Expand Down
3 changes: 2 additions & 1 deletion lib/neo4j/core/cypher_session/adaptors/http.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'neo4j/core/cypher_session/adaptors'
require 'neo4j/core/cypher_session/adaptors/has_uri'
require 'neo4j/core/cypher_session/responses/http'
require 'typhoeus/adapters/faraday'

# TODO: Work with `Query` objects
module Neo4j
Expand Down Expand Up @@ -143,7 +144,7 @@ def faraday_connection
c.request :multi_json

c.response :multi_json, symbolize_keys: true, content_type: 'application/json'
c.use Faraday::Adapter::NetHttpPersistent
c.use Faraday::Adapter::Typhoeus

# c.response :logger, ::Logger.new(STDOUT), bodies: true

Expand Down
2 changes: 1 addition & 1 deletion neo4j-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Neo4j-core provides classes and methods to work with the graph database Neo4j.
s.rdoc_options = ['--quiet', '--title', 'Neo4j::Core', '--line-numbers', '--main', 'README.rdoc', '--inline-source']

s.add_dependency('faraday', '~> 0.9.0')
s.add_dependency('net-http-persistent', '~> 2.9.4')
s.add_dependency('typhoeus', '~> 1.1.0')
s.add_dependency('httpclient')
s.add_dependency('faraday_middleware', '~> 0.10.0')
s.add_dependency('json')
Expand Down