httpx 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/1_7_1.md +1 -2
  3. data/doc/release_notes/1_8_1.md +27 -0
  4. data/doc/release_notes/1_8_2.md +30 -0
  5. data/lib/httpx/adapters/datadog.rb +9 -0
  6. data/lib/httpx/adapters/faraday.rb +2 -2
  7. data/lib/httpx/adapters/webmock.rb +8 -1
  8. data/lib/httpx/buffer.rb +5 -0
  9. data/lib/httpx/connection/http1.rb +6 -12
  10. data/lib/httpx/connection/http2.rb +38 -10
  11. data/lib/httpx/connection.rb +86 -27
  12. data/lib/httpx/errors.rb +3 -0
  13. data/lib/httpx/headers.rb +2 -2
  14. data/lib/httpx/io/ssl.rb +26 -17
  15. data/lib/httpx/io/tcp.rb +11 -4
  16. data/lib/httpx/io/unix.rb +2 -2
  17. data/lib/httpx/loggable.rb +11 -4
  18. data/lib/httpx/options.rb +6 -2
  19. data/lib/httpx/plugins/auth/digest.rb +1 -1
  20. data/lib/httpx/plugins/auth.rb +17 -7
  21. data/lib/httpx/plugins/callbacks.rb +12 -0
  22. data/lib/httpx/plugins/digest_auth.rb +4 -0
  23. data/lib/httpx/plugins/fiber_concurrency.rb +25 -1
  24. data/lib/httpx/plugins/follow_redirects.rb +21 -9
  25. data/lib/httpx/plugins/oauth.rb +4 -2
  26. data/lib/httpx/plugins/persistent.rb +33 -2
  27. data/lib/httpx/plugins/proxy.rb +9 -3
  28. data/lib/httpx/plugins/push_promise.rb +2 -2
  29. data/lib/httpx/plugins/retries.rb +15 -8
  30. data/lib/httpx/plugins/server_sent_events.rb +1 -1
  31. data/lib/httpx/plugins/ssrf_filter.rb +1 -1
  32. data/lib/httpx/plugins/stream.rb +2 -2
  33. data/lib/httpx/plugins/stream_bidi.rb +2 -0
  34. data/lib/httpx/plugins/tracing.rb +17 -4
  35. data/lib/httpx/pool.rb +2 -2
  36. data/lib/httpx/request/body.rb +10 -7
  37. data/lib/httpx/request.rb +27 -12
  38. data/lib/httpx/resolver/cache/base.rb +1 -8
  39. data/lib/httpx/resolver/https.rb +20 -20
  40. data/lib/httpx/resolver/native.rb +11 -0
  41. data/lib/httpx/resolver/resolver.rb +4 -0
  42. data/lib/httpx/resolver/system.rb +5 -2
  43. data/lib/httpx/response/body.rb +2 -2
  44. data/lib/httpx/response.rb +6 -7
  45. data/lib/httpx/selector.rb +6 -1
  46. data/lib/httpx/session.rb +11 -3
  47. data/lib/httpx/session_extensions.rb +2 -2
  48. data/lib/httpx/timers.rb +3 -0
  49. data/lib/httpx/transcoder/json.rb +1 -2
  50. data/lib/httpx/transcoder/utils/deflater.rb +1 -2
  51. data/lib/httpx/version.rb +1 -1
  52. data/sig/connection/http2.rbs +3 -0
  53. data/sig/connection.rbs +8 -3
  54. data/sig/errors.rbs +2 -2
  55. data/sig/io/ssl.rbs +5 -0
  56. data/sig/loggable.rbs +4 -0
  57. data/sig/plugins/auth.rbs +7 -3
  58. data/sig/plugins/persistent.rbs +7 -0
  59. data/sig/plugins/retries.rbs +4 -2
  60. data/sig/plugins/tracing.rbs +1 -1
  61. data/sig/request.rbs +2 -3
  62. data/sig/resolver/system.rbs +3 -0
  63. data/sig/selector.rbs +2 -0
  64. data/sig/timers.rbs +2 -0
  65. metadata +6 -2
@@ -1,11 +1,18 @@
1
1
  module HTTPX
2
2
  module Plugins
3
3
  module Persistent
4
+ SAFE_REONNECTABLE_ERRORS: Array[singleton(StandardError)]
5
+
4
6
  def self.load_dependencies: (singleton(Session)) -> void
5
7
 
6
8
  def self.extra_options: (Options) -> (Options)
7
9
 
8
10
  module InstanceMethods
11
+ private
12
+
13
+ def reconnectable_error?: (StandardError error) -> bool
14
+
15
+ def safe_reconnectable_error?: (StandardError error) -> bool
9
16
  end
10
17
  end
11
18
 
@@ -45,9 +45,11 @@ module HTTPX
45
45
 
46
46
  def try_partial_retry: (retriesRequest request, retriesResponse response) -> void
47
47
 
48
- def prepare_to_retry: (Request & RequestMethods request, retriesResponse response) -> void
48
+ def prepare_to_retry: (retriesRequest request, retriesResponse response) -> void
49
49
 
50
- def when_to_retry: (Request & RequestMethods request, retriesResponse response, retriesOptions options) -> Numeric?
50
+ def can_reconnect?: (retriesRequest request, retriesResponse response) -> bool
51
+
52
+ def when_to_retry: (retriesRequest request, retriesResponse response, retriesOptions options) -> Numeric?
51
53
  end
52
54
 
53
55
  module RequestMethods
@@ -30,7 +30,7 @@ module HTTPX
30
30
  end
31
31
 
32
32
  module ConnectionMethods
33
- @init_time: Time
33
+ @init_time: Time?
34
34
  end
35
35
 
36
36
  type retriesRequest = Request & RequestMethods
data/sig/request.rbs CHANGED
@@ -17,7 +17,7 @@ module HTTPX
17
17
  attr_reader response: response?
18
18
  attr_reader http2_stream_options: { ?dependency: Integer, ?exclusive: bool, ?weight: Integer }
19
19
  attr_reader drain_error: StandardError?
20
- attr_reader active_timeouts: Array[Symbol]
20
+ attr_reader active_timeouts: Array[Timers::Timer]
21
21
 
22
22
  attr_writer connection: Connection?
23
23
  attr_writer on_response_arrived: (^() -> void)?
@@ -93,7 +93,6 @@ module HTTPX
93
93
 
94
94
  private
95
95
 
96
- def initialize_body: (Options options) -> Transcoder::_Encoder?
97
-
96
+ def reset_timers: (bool reset_total_request_timers) -> void
98
97
  end
99
98
  end
@@ -5,6 +5,9 @@ module HTTPX
5
5
  DONE: 1
6
6
  ERROR: 2
7
7
 
8
+ class AddrinfoTimeoutError < StandardError
9
+ end
10
+
8
11
  @resolver: Resolv::DNS
9
12
  @_timeouts: Array[interval]
10
13
  @timeouts: Hash[String, Array[interval]]
data/sig/selector.rbs CHANGED
@@ -6,6 +6,8 @@ module HTTPX
6
6
 
7
7
  def call: () -> void
8
8
 
9
+ def initial_call: () -> void
10
+
9
11
  def interests: () -> io_interests?
10
12
 
11
13
  def timeout: () -> interval?
data/sig/timers.rbs CHANGED
@@ -48,6 +48,8 @@ module HTTPX
48
48
  @interval: Interval
49
49
  @callback: callback
50
50
 
51
+ attr_accessor label: Symbol?
52
+
51
53
  def initialize: (Interval interval, callback callback) -> void
52
54
 
53
55
  def cancel: () -> void
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -169,6 +169,8 @@ extra_rdoc_files:
169
169
  - doc/release_notes/1_7_7.md
170
170
  - doc/release_notes/1_7_8.md
171
171
  - doc/release_notes/1_8_0.md
172
+ - doc/release_notes/1_8_1.md
173
+ - doc/release_notes/1_8_2.md
172
174
  files:
173
175
  - LICENSE.txt
174
176
  - README.md
@@ -310,6 +312,8 @@ files:
310
312
  - doc/release_notes/1_7_7.md
311
313
  - doc/release_notes/1_7_8.md
312
314
  - doc/release_notes/1_8_0.md
315
+ - doc/release_notes/1_8_1.md
316
+ - doc/release_notes/1_8_2.md
313
317
  - lib/httpx.rb
314
318
  - lib/httpx/adapters/datadog.rb
315
319
  - lib/httpx/adapters/faraday.rb
@@ -555,7 +559,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
555
559
  - !ruby/object:Gem::Version
556
560
  version: '0'
557
561
  requirements: []
558
- rubygems_version: 3.6.9
562
+ rubygems_version: 4.0.16
559
563
  specification_version: 4
560
564
  summary: HTTPX, to the future, and beyond
561
565
  test_files: []