httpx 1.6.1 → 1.6.3

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes/1_6_2.md +11 -0
  3. data/doc/release_notes/1_6_3.md +47 -0
  4. data/lib/httpx/adapters/datadog.rb +15 -11
  5. data/lib/httpx/adapters/sentry.rb +1 -1
  6. data/lib/httpx/connection/http1.rb +9 -9
  7. data/lib/httpx/connection/http2.rb +14 -15
  8. data/lib/httpx/connection.rb +119 -102
  9. data/lib/httpx/extensions.rb +0 -14
  10. data/lib/httpx/io/ssl.rb +1 -1
  11. data/lib/httpx/loggable.rb +12 -2
  12. data/lib/httpx/options.rb +20 -0
  13. data/lib/httpx/plugins/callbacks.rb +15 -1
  14. data/lib/httpx/plugins/digest_auth.rb +1 -1
  15. data/lib/httpx/plugins/proxy/http.rb +37 -9
  16. data/lib/httpx/plugins/response_cache/file_store.rb +1 -0
  17. data/lib/httpx/plugins/response_cache.rb +13 -2
  18. data/lib/httpx/plugins/stream_bidi.rb +15 -6
  19. data/lib/httpx/pool.rb +53 -19
  20. data/lib/httpx/request.rb +3 -13
  21. data/lib/httpx/resolver/https.rb +35 -19
  22. data/lib/httpx/resolver/multi.rb +9 -32
  23. data/lib/httpx/resolver/native.rb +46 -38
  24. data/lib/httpx/resolver/resolver.rb +45 -28
  25. data/lib/httpx/resolver/system.rb +63 -39
  26. data/lib/httpx/selector.rb +35 -20
  27. data/lib/httpx/session.rb +18 -28
  28. data/lib/httpx/transcoder/deflate.rb +13 -8
  29. data/lib/httpx/transcoder/utils/body_reader.rb +1 -2
  30. data/lib/httpx/transcoder/utils/deflater.rb +1 -2
  31. data/lib/httpx/version.rb +1 -1
  32. data/sig/connection.rbs +12 -3
  33. data/sig/loggable.rbs +5 -1
  34. data/sig/options.rbs +5 -1
  35. data/sig/plugins/callbacks.rbs +3 -0
  36. data/sig/plugins/stream_bidi.rbs +3 -5
  37. data/sig/resolver/https.rbs +2 -0
  38. data/sig/resolver/multi.rbs +0 -9
  39. data/sig/resolver/native.rbs +0 -2
  40. data/sig/resolver/resolver.rbs +9 -8
  41. data/sig/resolver/system.rbs +4 -2
  42. data/sig/selector.rbs +2 -0
  43. data/sig/session.rbs +5 -3
  44. metadata +5 -1
@@ -5,7 +5,7 @@ module HTTPX
5
5
 
6
6
  def self.extra_options: (Options) -> (Options)
7
7
 
8
- class HTTP2Bidi < Connection::HTTP2
8
+ module HTTP2Methods
9
9
  @lock: Thread::Mutex
10
10
 
11
11
  private
@@ -24,6 +24,8 @@ module HTTPX
24
24
  end
25
25
 
26
26
  class Signal
27
+ attr_reader error: Exception?
28
+
27
29
  @closed: bool
28
30
  @pipe_read: IO
29
31
  @pipe_write: IO
@@ -55,10 +57,6 @@ module HTTPX
55
57
 
56
58
  module ConnectionMethods
57
59
  @write_buffer: BidiBuffer
58
-
59
- private
60
-
61
- def parser_type: (String protocol) -> (singleton(Connection::HTTP1) | singleton(Connection::HTTP2) | singleton(HTTP2Bidi))
62
60
  end
63
61
 
64
62
  end
@@ -40,6 +40,8 @@ module HTTPX
40
40
  def decode_response_body: (Response) -> dns_decoding_response
41
41
 
42
42
  def reset_hostname: (String hostname, ?reset_candidates: bool) -> Connection?
43
+
44
+ def close_or_resolve: (?bool should_deactivate) -> void
43
45
  end
44
46
  end
45
47
  end
@@ -8,7 +8,6 @@ module HTTPX
8
8
  @current_selector: Selector?
9
9
  @current_session: Session?
10
10
  @resolver_options: Hash[Symbol, untyped]
11
- # @errors: Hash[Symbol, untyped]
12
11
 
13
12
  def current_selector=: (Selector s) -> void
14
13
 
@@ -16,14 +15,6 @@ module HTTPX
16
15
 
17
16
  def closed?: () -> bool
18
17
 
19
- def empty?: () -> bool
20
-
21
- def timeout: () -> Numeric?
22
-
23
- def close: () -> void
24
-
25
- def connections: () -> Array[Connection]
26
-
27
18
  def early_resolve: (Connection connection) -> bool
28
19
 
29
20
  def lazy_resolve: (Connection connection) -> void
@@ -64,8 +64,6 @@ module HTTPX
64
64
 
65
65
  def transition: (Symbol nextstate) -> void
66
66
 
67
- def handle_error: (NativeResolveError | StandardError) -> void
68
-
69
67
  def reset_hostname: (String hostname, ?connection: Connection, ?reset_candidates: bool) -> void
70
68
 
71
69
  def close_or_resolve: () -> void
@@ -1,7 +1,6 @@
1
1
  module HTTPX
2
2
  module Resolver
3
3
  class Resolver
4
- include Callbacks
5
4
  include Loggable
6
5
 
7
6
  include _Selectable
@@ -26,7 +25,9 @@ module HTTPX
26
25
 
27
26
  def close: () -> void
28
27
 
29
- alias terminate close
28
+ def terminate: () -> void
29
+
30
+ def force_close: (*untyped args) -> void
30
31
 
31
32
  def closed?: () -> bool
32
33
 
@@ -36,8 +37,12 @@ module HTTPX
36
37
 
37
38
  def emit_addresses: (Connection connection, ip_family family, Array[ipaddr], ?bool early_resolve) -> void
38
39
 
40
+ def handle_error: (ResolveError | StandardError) -> void
41
+
39
42
  def self.multi?: () -> bool
40
43
 
44
+ def early_resolve: (Connection connection, ?hostname: String) -> bool
45
+
41
46
  private
42
47
 
43
48
  def resolve: (?Connection connection, ?String hostname) -> void
@@ -46,19 +51,15 @@ module HTTPX
46
51
 
47
52
  def initialize: (ip_family family, Options options) -> void
48
53
 
49
- def early_resolve: (Connection connection, ?hostname: String) -> bool
50
-
51
- def set_resolver_callbacks: () -> void
52
-
53
54
  def resolve_connection: (Connection connection) -> void
54
55
 
55
56
  def emit_connection_error: (Connection connection, StandardError error) -> void
56
57
 
57
- def close_resolver: (Resolver resolver) -> void
58
-
59
58
  def emit_resolve_error: (Connection connection, ?String hostname, ?StandardError) -> void
60
59
 
61
60
  def resolve_error: (String hostname, ?StandardError?) -> (ResolveError | ResolveTimeoutError)
61
+
62
+ def close_or_resolve: () -> void
62
63
  end
63
64
  end
64
65
  end
@@ -16,7 +16,9 @@ module HTTPX
16
16
 
17
17
  attr_reader state: Symbol
18
18
 
19
- def <<: (Connection) -> void
19
+ def initialize: (Options options) -> void
20
+
21
+ def lazy_resolve: (Connection connection) -> void
20
22
 
21
23
  private
22
24
 
@@ -28,7 +30,7 @@ module HTTPX
28
30
 
29
31
  def __addrinfo_resolve: (String host, String scheme) -> Array[Addrinfo]
30
32
 
31
- def initialize: (Options options) -> void
33
+ def close_or_resolve: () -> void
32
34
  end
33
35
  end
34
36
  end
data/sig/selector.rbs CHANGED
@@ -11,6 +11,8 @@ module HTTPX
11
11
  def timeout: () -> Numeric?
12
12
 
13
13
  def handle_socket_timeout: (Numeric interval) -> void
14
+
15
+ def on_error: (StandardError) -> void
14
16
  end
15
17
 
16
18
  class Selector
data/sig/session.rbs CHANGED
@@ -15,6 +15,8 @@ module HTTPX
15
15
  @wrapped: bool
16
16
  @closing: bool
17
17
 
18
+ type resolver = Resolver::Multi | Resolver::Resolver
19
+
18
20
  def wrap: () { (instance) -> void } -> void
19
21
 
20
22
  def close: (?Selector selector) -> void
@@ -23,11 +25,11 @@ module HTTPX
23
25
 
24
26
  def select_connection: (Connection connection, Selector selector) -> void
25
27
 
26
- def pin_connection: (Resolver::Resolver | Connection connection, Selector selector) -> void
28
+ def pin: (resolver | Connection conn_or_resolver, Selector selector) -> void
27
29
 
28
30
  def deselect_connection: (Connection connection, Selector selector, ?bool cloned) -> void
29
31
 
30
- def select_resolver: (Resolver::Native | Resolver::HTTPS resolver, Selector selector) -> void
32
+ def select_resolver: (Resolver::Resolver resolver, Selector selector) -> void
31
33
 
32
34
  def deselect_resolver: (Resolver::Resolver resolver, Selector selector) -> void
33
35
 
@@ -72,7 +74,7 @@ module HTTPX
72
74
 
73
75
  def on_resolver_close: (Resolver::Resolver resolver, Selector selector) -> void
74
76
 
75
- def find_resolver_for: (Connection connection, Selector selector) -> (Resolver::Multi | Resolver::Resolver)
77
+ def find_resolver_for: (Connection connection, Selector selector) -> resolver
76
78
 
77
79
  def coalesce_connections: (Connection conn1, Connection conn2, Selector selector, bool from_pool) -> bool
78
80
 
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.6.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -157,6 +157,8 @@ extra_rdoc_files:
157
157
  - doc/release_notes/1_5_1.md
158
158
  - doc/release_notes/1_6_0.md
159
159
  - doc/release_notes/1_6_1.md
160
+ - doc/release_notes/1_6_2.md
161
+ - doc/release_notes/1_6_3.md
160
162
  files:
161
163
  - LICENSE.txt
162
164
  - README.md
@@ -286,6 +288,8 @@ files:
286
288
  - doc/release_notes/1_5_1.md
287
289
  - doc/release_notes/1_6_0.md
288
290
  - doc/release_notes/1_6_1.md
291
+ - doc/release_notes/1_6_2.md
292
+ - doc/release_notes/1_6_3.md
289
293
  - lib/httpx.rb
290
294
  - lib/httpx/adapters/datadog.rb
291
295
  - lib/httpx/adapters/faraday.rb