net-http2 0.18.2 → 0.18.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 95fc93bdd8b50189e2626626ff71002bddab0759
4
- data.tar.gz: bfbf47643cd60f817a24e5c9de8e41c4fcb642d6
2
+ SHA256:
3
+ metadata.gz: 47851ec1e94857e836b5e282289ee6295903bf37ad86ea6922d100eac62d002b
4
+ data.tar.gz: 7f2e870165baf00d5cd6cc5c5e42915a7f918f0567ce446c14aec0dd5f011a32
5
5
  SHA512:
6
- metadata.gz: 35faa1b583f4f4803b87368f523423e45725f1788fda2d8b94881aed0d890802afe6467d089636008268ee8b41e9d106021d84a3120934d6f25f2b0b6ea4a1e7
7
- data.tar.gz: 7c288e87540b1b9a041296168d3b9679b4fa3a7b4c9b44ba9d9f737f46fdaccb85d632ee8cd506dd866cc90107b0f6f628e6e29149ffa3bb0a29f2a12560e7b1
6
+ metadata.gz: ace452983904e4c82024a59bb8222bc31eb44f8251402a21dee6f6e1395e57c18fd02ee6677e43415f9af5a15dafd510de3eebd54769926fa5ed42de79bc2978
7
+ data.tar.gz: f409ce5ec39eb3a565095cb4831cb04153153d308abeeea75fcac010f07fa48cf9100ee1e7cc925e68fa0d8b50d3c56c96fd030835a6aacf07d37c5d8e673344
@@ -0,0 +1 @@
1
+ ruby 2.7.1
@@ -1,10 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
- - 2.3
5
3
  - 2.4
6
4
  - 2.5
5
+ - 2.6
6
+ - 2.7
7
7
 
8
8
  branches:
9
9
  only:
10
10
  - master
11
+
12
+ before_install:
13
+ - gem install bundler
data/README.md CHANGED
@@ -59,7 +59,7 @@ request.on(:close) { puts "request completed!" }
59
59
  client.call_async(request)
60
60
 
61
61
  # Wait for all outgoing stream to be closed
62
- client.join
62
+ client.join(timeout: 5)
63
63
 
64
64
  # close the connection
65
65
  client.close
@@ -103,7 +103,7 @@ Allows to set a callback for the client. The only available event is `:error`, w
103
103
  client.on(:error) { |exception| puts "Exception has been raised: #{exception}" }
104
104
  ```
105
105
 
106
- > It is RECOMMENDED to set the `:error` callback: if none is defined, the underlying socket thread may raise an error in the main thread at unexpected execution times.
106
+ > It is RECOMMENDED to set the `:error` callback: if none is defined, the underlying socket thread may raise an error in the main thread at unexpected execution times.
107
107
 
108
108
  * **uri** → **`URI`**
109
109
 
@@ -140,9 +140,9 @@ The real benefit of HTTP/2 is being able to receive body and header streams. Ins
140
140
 
141
141
  Calls the server with the async request.
142
142
 
143
- * **join**
143
+ * **join(timeout:)**
144
144
 
145
- Wait for all outstanding requests to be completed.
145
+ Wait for all outstanding requests to be completed, optionally with a timeout for this condition to be met. Raises NetHttp2::AsyncRequestTimeout if the timeout is reached.
146
146
 
147
147
 
148
148
  ### `NetHttp2::Request`
@@ -8,6 +8,8 @@ module NetHttp2
8
8
  DRAFT = 'h2'
9
9
  PROXY_SETTINGS_KEYS = [:proxy_addr, :proxy_port, :proxy_user, :proxy_pass]
10
10
 
11
+ AsyncRequestTimeout = Class.new(StandardError)
12
+
11
13
  class Client
12
14
 
13
15
  include Callbacks
@@ -54,8 +56,10 @@ module NetHttp2
54
56
  init_vars
55
57
  end
56
58
 
57
- def join
59
+ def join(timeout: nil)
60
+ starting_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
58
61
  while !@streams.empty? do
62
+ raise AsyncRequestTimeout if timeout && Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting_time > timeout
59
63
  sleep 0.05
60
64
  end
61
65
  end
@@ -1,3 +1,3 @@
1
1
  module NetHttp2
2
- VERSION = '0.18.2'.freeze
2
+ VERSION = '0.18.3'.freeze
3
3
  end
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "http-2", "~> 0.10.1"
23
23
 
24
24
  spec.add_development_dependency "bundler"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake", ">= 12.3.3"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Ostinelli
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: 12.3.3
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: 12.3.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - roberto@ostinelli.net
72
72
  executables: []
@@ -75,8 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
- - ".ruby-gemset"
79
- - ".ruby-version"
78
+ - ".tool-versions"
80
79
  - ".travis.yml"
81
80
  - Gemfile
82
81
  - LICENSE.md
@@ -97,7 +96,7 @@ homepage: http://github.com/ostinelli/net-http2
97
96
  licenses:
98
97
  - MIT
99
98
  metadata: {}
100
- post_install_message:
99
+ post_install_message:
101
100
  rdoc_options: []
102
101
  require_paths:
103
102
  - lib
@@ -112,9 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  - !ruby/object:Gem::Version
113
112
  version: '0'
114
113
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.6.14
117
- signing_key:
114
+ rubygems_version: 3.1.2
115
+ signing_key:
118
116
  specification_version: 4
119
117
  summary: NetHttp2 is an HTTP2 client for Ruby.
120
118
  test_files: []
@@ -1 +0,0 @@
1
- net-http2
@@ -1 +0,0 @@
1
- ruby-2.3.1