elasticsearch-transport 7.8.0.pre → 7.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b922c1e2131a848cc6fa68e4f3559b7e47a48d794ff51f80a133bf3bb5e8dc75
4
- data.tar.gz: 4f544cd657f098844fa0b67f12e1ac1ead3085095cad9b06d433bd6919593179
3
+ metadata.gz: 4dfe3d9fae3bb774616e233bf92b39eb0aa4a59485af2f842ab5b71b2811dce4
4
+ data.tar.gz: 878ee8379c414a3c6c4a53f6656c53e929ba18c4774f33276d85bbad603ce3c0
5
5
  SHA512:
6
- metadata.gz: 711e4ce60c75f815947f0040c6f5c1b64767312068397f60c0fa43af8ed460dd8d3656609e8843b6e18dfdf7e2e78b7d860a32a0f1615aacb757f434b23f1b3d
7
- data.tar.gz: ed2ffecfea9ace873a32a49c370abfa5162e6de668ea4c5afcce50fe18a265054a2bf43e317022367123cceb8ec0b018b26ed83c5158c894563c4d71a019ed6c
6
+ metadata.gz: 78aaba580583c70dae6dc2fa798dbf2cc4d0ff150401f2fc2a0f26c5b2f58ad938e53bd1d6fc4a69d8fd95205bbfe389b8af6744b65c61ec5ffe71c8df32daf0
7
+ data.tar.gz: 6fcc484b27d6b61d57162a195d43b9fa97e7c86da86461ca530fd233e3c97c32a495ff28a6a0d31771a70e28213234ed61c38a75846cd0b32122db37e15661a7
data/README.md CHANGED
@@ -28,16 +28,16 @@ Features overview:
28
28
  * Node reloading (based on cluster state) on errors or on demand
29
29
 
30
30
  For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections,
31
- such as [patron](https://github.com/toland/patron).
32
- Just require the library (`require 'patron'`) in your code,
33
- and it will be automatically used.
31
+ such as [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus).
32
+ Just require the library (`require 'patron'`) in your code, and it will be automatically used.
34
33
 
35
34
  Currently these libraries will be automatically detected and used:
36
35
  - [Patron](https://github.com/toland/patron)
36
+ - [Typhoeus](https://github.com/typhoeus/typhoeus)
37
37
  - [HTTPClient](https://rubygems.org/gems/httpclient)
38
38
  - [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent)
39
39
 
40
- **Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: Typhoeus is compatible and will be automatically detected too. However, the latest release (v1.3.1 at the moment of writing this) is not compatible with Faraday 1.0. [It still uses the deprecated `Faraday::Error` namespace](https://github.com/typhoeus/typhoeus/blob/v1.3.1/lib/typhoeus/adapters/faraday.rb#L100). If you want to use it with this gem, we suggest getting `master` from GitHub, since this has been fixed for v1.4.0. We'll update this if/when v1.4.0 is released.a
40
+ **Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: You need to use v1.4.0 or up since older versions are not compatible with Faraday 1.0.
41
41
 
42
42
  For detailed information, see example configurations [below](#transport-implementations).
43
43
 
@@ -67,7 +67,7 @@ Gem::Specification.new do |s|
67
67
  s.add_development_dependency 'pry'
68
68
  s.add_development_dependency 'shoulda-context'
69
69
  s.add_development_dependency 'test-unit', '~> 2'
70
- s.add_development_dependency 'typhoeus', '~> 0.6'
70
+ s.add_development_dependency 'typhoeus', '~> 1.4'
71
71
  s.add_development_dependency 'yard'
72
72
  s.add_development_dependency 'bundler'
73
73
 
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elasticsearch
19
19
  module Transport
20
- VERSION = "7.8.0.pre"
20
+ VERSION = "7.8.0"
21
21
  end
22
22
  end
@@ -240,8 +240,7 @@ describe Elasticsearch::Transport::Client do
240
240
  end
241
241
  end
242
242
 
243
- context 'when the adapter is specified' do
244
-
243
+ context 'when the adapter is patron' do
245
244
  let(:adapter) do
246
245
  client.transport.connections.all.first.connection.builder.adapter
247
246
  end
@@ -255,8 +254,21 @@ describe Elasticsearch::Transport::Client do
255
254
  end
256
255
  end
257
256
 
258
- context 'when the adapter is specified as a string key' do
257
+ context 'when the adapter is typhoeus' do
258
+ let(:adapter) do
259
+ client.transport.connections.all.first.connection.builder.adapter
260
+ end
261
+
262
+ let(:client) do
263
+ described_class.new(adapter: :typhoeus)
264
+ end
265
+
266
+ it 'uses Faraday with the adapter' do
267
+ expect(adapter).to eq Faraday::Adapter::Typhoeus
268
+ end
269
+ end
259
270
 
271
+ context 'when the adapter is specified as a string key' do
260
272
  let(:adapter) do
261
273
  client.transport.connections.all.first.connection.builder.adapter
262
274
  end
@@ -1629,6 +1641,33 @@ describe Elasticsearch::Transport::Client do
1629
1641
  expect(connections_after).to be >= (connections_before)
1630
1642
  end
1631
1643
  end
1644
+
1645
+ context 'when typhoeus is used as an adapter', unless: jruby? do
1646
+ before do
1647
+ require 'typhoeus'
1648
+ end
1649
+
1650
+ let(:options) do
1651
+ { adapter: :typhoeus }
1652
+ end
1653
+
1654
+ let(:adapter) do
1655
+ client.transport.connections.first.connection.builder.adapter
1656
+ end
1657
+
1658
+ it 'uses the patron connection handler' do
1659
+ expect(adapter).to eq('Faraday::Adapter::Typhoeus')
1660
+ end
1661
+
1662
+ it 'keeps connections open' do
1663
+ response = client.perform_request('GET', '_nodes/stats/http')
1664
+ connections_before = response.body['nodes'].values.find { |n| n['name'] == node_names.first }['http']['total_opened']
1665
+ client.transport.reload_connections!
1666
+ response = client.perform_request('GET', '_nodes/stats/http')
1667
+ connections_after = response.body['nodes'].values.find { |n| n['name'] == node_names.first }['http']['total_opened']
1668
+ expect(connections_after).to be >= (connections_before)
1669
+ end
1670
+ end
1632
1671
  end
1633
1672
  end
1634
1673
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.8.0.pre
4
+ version: 7.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-29 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -316,14 +316,14 @@ dependencies:
316
316
  requirements:
317
317
  - - "~>"
318
318
  - !ruby/object:Gem::Version
319
- version: '0.6'
319
+ version: '1.4'
320
320
  type: :development
321
321
  prerelease: false
322
322
  version_requirements: !ruby/object:Gem::Requirement
323
323
  requirements:
324
324
  - - "~>"
325
325
  - !ruby/object:Gem::Version
326
- version: '0.6'
326
+ version: '1.4'
327
327
  - !ruby/object:Gem::Dependency
328
328
  name: yard
329
329
  requirement: !ruby/object:Gem::Requirement
@@ -423,9 +423,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
423
423
  version: '2.4'
424
424
  required_rubygems_version: !ruby/object:Gem::Requirement
425
425
  requirements:
426
- - - ">"
426
+ - - ">="
427
427
  - !ruby/object:Gem::Version
428
- version: 1.3.1
428
+ version: '0'
429
429
  requirements: []
430
430
  rubygems_version: 3.1.2
431
431
  signing_key: