protocol-http2 0.12.0 → 0.13.0

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
2
  SHA256:
3
- metadata.gz: 99c1f6c39bfa00e6f872c275ce33513a8a5668abd84f790cf3125af3b1d6c5fd
4
- data.tar.gz: 5e28c4e9f222db72ef413c88dc0205351688557510e81c408051c147da5e4cea
3
+ metadata.gz: 68ab10b4b60dee6916f40c2f3d2c291f7358371b76a323527e29dc010a8dd250
4
+ data.tar.gz: 1a7d0c6e216b4c01ee49bf3052da5bd66cef3891ef1c5c321aa19443d1f3ba07
5
5
  SHA512:
6
- metadata.gz: 55a6923f22ad89c5c831cafc45bec918424ea368326f1e584fece860cb9e7c8e001c331b39ce5673db7b28cb2cd8df9b4c3994367b27846e63b3d0013d60c147
7
- data.tar.gz: a0b0a7e36751c4da1472c3a8f26a90c9a55af83a5449a563b20bd5f78b734df659fdecd6f70222a006338e011b7e6e117fa68150deaab0c274e7fef411da2a00
6
+ metadata.gz: 1963aa287377f7e242a6ac386a2a05c04e8c392b0bedbccd0b1d55a5dc88fb7ac0e26a3b7fb6bededb13ef52d27ee5576c5a9ad8479b8f918abb853e28e3802a
7
+ data.tar.gz: 60c3428b7b58c20d43e1486bec532d848cc3cc84de4a748c01963ad58ad93b51c0dfac08c999123ca20240f8e6134ce7a45b003265d0b38ceed0cb57fb7a7a06
data/README.md CHANGED
@@ -29,7 +29,6 @@ require 'async'
29
29
  require 'async/io/stream'
30
30
  require 'async/http/endpoint'
31
31
  require 'protocol/http2/client'
32
- require 'pry'
33
32
 
34
33
  Async do
35
34
  endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
@@ -83,8 +82,6 @@ Async do
83
82
 
84
83
  puts "Got #{$count} kittens!"
85
84
 
86
- binding.pry
87
-
88
85
  puts "Closing client..."
89
86
  client.close
90
87
  end
@@ -5,7 +5,6 @@ require 'async'
5
5
  require 'async/io/stream'
6
6
  require 'async/http/endpoint'
7
7
  require 'protocol/http2/client'
8
- require 'pry'
9
8
 
10
9
  Async do
11
10
  endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
@@ -59,8 +58,6 @@ Async do
59
58
 
60
59
  puts "Got #{$count} kittens!"
61
60
 
62
- binding.pry
63
-
64
61
  puts "Closing client..."
65
62
  client.close
66
63
  end
@@ -5,7 +5,6 @@ require 'async'
5
5
  require 'async/io/stream'
6
6
  require 'async/http/endpoint'
7
7
  require 'protocol/http2/client'
8
- require 'pry'
9
8
 
10
9
  queries = ["apple", "orange", "teapot", "async"]
11
10
 
@@ -124,10 +124,6 @@ module Protocol
124
124
  @dependency.parent = stream.dependency
125
125
  end
126
126
 
127
- # The stream is being closed because the connection is being closed.
128
- def close(error = nil)
129
- end
130
-
131
127
  def maximum_frame_size
132
128
  @connection.available_frame_size
133
129
  end
@@ -144,6 +140,15 @@ module Protocol
144
140
  @state == :closed
145
141
  end
146
142
 
143
+ # Transition directly to closed state. Do not pass go, do not collect $200.
144
+ # This method should only be used by `Connection#close`.
145
+ def close(error = nil)
146
+ unless closed?
147
+ @state = :closed
148
+ self.closed(error)
149
+ end
150
+ end
151
+
147
152
  def send_headers?
148
153
  @state == :idle or @state == :reserved_local or @state == :open or @state == :half_closed_remote
149
154
  end
@@ -228,6 +233,10 @@ module Protocol
228
233
  end
229
234
  end
230
235
 
236
+ # The stream has been opened.
237
+ def opened(error = nil)
238
+ end
239
+
231
240
  def open!
232
241
  if @state == :idle
233
242
  @state = :open
@@ -235,9 +244,15 @@ module Protocol
235
244
  raise ProtocolError, "Cannot open stream in state: #{@state}"
236
245
  end
237
246
 
247
+ self.opened
248
+
238
249
  return self
239
250
  end
240
251
 
252
+ # The stream has been closed. If closed due to a stream reset, the error will be set.
253
+ def closed(error = nil)
254
+ end
255
+
241
256
  # Transition the stream into the closed state.
242
257
  # @param error_code [Integer] the error code if the stream was closed due to a stream reset.
243
258
  def close!(error_code = nil)
@@ -248,7 +263,7 @@ module Protocol
248
263
  error = StreamError.new("Stream closed!", error_code)
249
264
  end
250
265
 
251
- self.close(error)
266
+ self.closed(error)
252
267
 
253
268
  return self
254
269
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP2
23
- VERSION = "0.12.0"
23
+ VERSION = "0.13.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2020-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: protocol-hpack
@@ -106,7 +106,6 @@ files:
106
106
  - ".travis.yml"
107
107
  - Gemfile
108
108
  - README.md
109
- - Rakefile
110
109
  - examples/http2/request.rb
111
110
  - examples/http2/requests.rb
112
111
  - lib/protocol/http2.rb
@@ -151,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
153
152
  requirements: []
154
- rubygems_version: 3.1.2
153
+ rubygems_version: 3.0.6
155
154
  signing_key:
156
155
  specification_version: 4
157
156
  summary: A low level implementation of the HTTP/2 protocol.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec