elastic-transport 8.1.0.pre2 → 8.1.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: '019bec0fce3232610f573b32a72456674018954609728aba574165f3e4b16393'
4
- data.tar.gz: 9f5ef21b2823bccf5c6e22c47420bf543931b1b76cd3b7050272cababffe2929
3
+ metadata.gz: 388aaaffda8babdfb8466e6aef816ed63bc520b56c7cb4f09964a23a1ab73854
4
+ data.tar.gz: 2bdc179dba8822d690bc1a1b41b9766996f5a39cf8d8b8d7fa1bc03662cdcc97
5
5
  SHA512:
6
- metadata.gz: 623ad8af7121423ae67655c684293a14f41faffbf76368fc8b2b4b23ce0a48793d238b209d3f8867808a8567b496d6186c8e700be9371d59839154f460f52eb3
7
- data.tar.gz: 7cdbcbcb8ab41e11a1a3acd5de8b25520b10823e2706cc8d432fb7057d06181cb0730272289614b34302182d925b82d31a422a0a664c461051db34ce81c3939d
6
+ metadata.gz: 45f117b13be213d5b85a17b1df2ecbafcc14fa566f7beda6bd39be8e26b4e5611f80b1d1bd5f3e0f9e35c726721f70e05c479ae112f9e2da97d2d21ff3af676a
7
+ data.tar.gz: 9b6d8a1fcc73da9676a309b11860640d6194bed392b1cdd91b4ef8b0ba407de11a8500f542efa588aa3f0a03c31dbef9e374f380c018fe297527ee486540a8b0
data/CHANGELOG.md CHANGED
@@ -1,8 +1,4 @@
1
- ## 8.1.0.pre2
2
-
3
- Updates Faraday's adapter detection code.
4
-
5
- ## 8.1.0.pre1
1
+ ## 8.1.0
6
2
 
7
3
  Adds support for Faraday version 2. From [Faraday's Upgrading guide](https://github.com/lostisland/faraday/blob/main/UPGRADING.md#faraday-20), the main change is the adapters have moved:
8
4
 
data/README.md CHANGED
@@ -42,10 +42,12 @@ Features overview:
42
42
  * Request retries and dead connections handling
43
43
  * Node reloading (based on cluster state) on errors or on demand
44
44
 
45
+ This library uses [Faraday](https://github.com/lostisland/faraday) by default as the HTTP transport implementation. We test it it with Faraday versions 1.x and Faraday 2.x.
46
+
45
47
  For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections, such as [patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus).
46
- Just require the library (`require 'patron'`) in your code, and it will be automatically used.
48
+ Require the library (`require 'patron'`) in your code for Faraday 1.x or the adapter (`require 'faraday/patron'`) for Faraday 2.x, and it will be automatically used.
47
49
 
48
- Currently these libraries will be automatically detected and used:
50
+ Currently these libraries are supported:
49
51
  - [Patron](https://github.com/toland/patron)
50
52
  - [Typhoeus](https://github.com/typhoeus/typhoeus)
51
53
  - [HTTPClient](https://rubygems.org/gems/httpclient)
@@ -53,12 +55,11 @@ Currently these libraries will be automatically detected and used:
53
55
 
54
56
  **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.
55
57
 
56
- For detailed information, see example configurations [below](#transport-implementations).
58
+ You can customize Faraday and implement your own HTTP transport. For detailed information, see the example configurations and more information [below](#transport-implementations).
57
59
 
58
60
  ## Example Usage
59
61
 
60
- In the simplest form, connect to Elasticsearch running on <http://localhost:9200>
61
- without any configuration:
62
+ In the simplest form, connect to Elasticsearch running on <http://localhost:9200> without any configuration:
62
63
 
63
64
  ```ruby
64
65
  require 'elastic/transport'
@@ -346,14 +347,23 @@ Elastic::Transport::Client.new hosts: ['x1.search.org', 'x2.search.org'], select
346
347
 
347
348
  By default, the client will use the [_Faraday_](https://rubygems.org/gems/faraday) HTTP library as a transport implementation.
348
349
 
349
- It will auto-detect and use an _adapter_ for _Faraday_ based on gems loaded in your code, preferring HTTP clients with support for persistent connections.
350
-
351
- To use the [_Patron_](https://github.com/toland/patron) HTTP, for example, just require it:
350
+ It will auto-detect and use an _adapter_ for _Faraday_ based on gems loaded in your code, preferring HTTP clients with support for persistent connections. Faraday 2 changed the way adapters are used ([read more here](https://github.com/lostisland/faraday/blob/main/UPGRADING.md#adapters-have-moved)). If you're using Faraday 1.x, you can require the HTTP library. To use the [_Patron_](https://github.com/toland/patron) HTTP, for example, require it:
352
351
 
353
352
  ```ruby
354
353
  require 'patron'
355
354
  ```
356
355
 
356
+ If you're using Faraday 2.x, you need to add the corresponding adapter gem to your Gemfile and require them after you require `faraday`:
357
+
358
+ ```ruby
359
+ # Gemfile
360
+ gem 'faraday-patron'
361
+
362
+ # Code
363
+ require 'faraday'
364
+ require 'faraday/patron'
365
+ ```
366
+
357
367
  Then, create a new client, and the _Patron_ gem will be used as the "driver":
358
368
 
359
369
  ```ruby
@@ -377,6 +387,10 @@ end
377
387
  To use a specific adapter for _Faraday_, pass it as the `adapter` argument:
378
388
 
379
389
  ```ruby
390
+ # Gemfile
391
+ gem 'faraday-net_http_persistent'
392
+
393
+ # Code
380
394
  client = Elastic::Transport::Client.new(adapter: :net_http_persistent)
381
395
 
382
396
  client.transport.connections.first.connection.builder.handlers
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44
44
 
45
45
  s.required_ruby_version = '>= 2.5'
46
46
 
47
- s.add_dependency 'faraday'
47
+ s.add_dependency 'faraday', '< 3'
48
48
  s.add_dependency 'multi_json'
49
49
 
50
50
  # Faraday Adapters
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.1.0.pre2'.freeze
20
+ VERSION = '8.1.0'.freeze
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0.pre2
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-08-24 00:00:00.000000000 Z
13
+ date: 2022-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - "<"
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: '3'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - "<"
27
27
  - !ruby/object:Gem::Version
28
- version: '0'
28
+ version: '3'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: multi_json
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -334,9 +334,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
334
334
  version: '2.5'
335
335
  required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  requirements:
337
- - - ">"
337
+ - - ">="
338
338
  - !ruby/object:Gem::Version
339
- version: 1.3.1
339
+ version: '0'
340
340
  requirements: []
341
341
  rubygems_version: 3.3.7
342
342
  signing_key: