biryani 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +7 -2
- data/example/echo.rb +2 -2
- data/example/hello_world.rb +2 -2
- data/lib/biryani/connection.rb +91 -96
- data/lib/biryani/data_buffer.rb +26 -16
- data/lib/biryani/frame/headers.rb +0 -2
- data/lib/biryani/http_response.rb +4 -20
- data/lib/biryani/state.rb +14 -2
- data/lib/biryani/streams_context.rb +60 -5
- data/lib/biryani/utils.rb +8 -0
- data/lib/biryani/version.rb +1 -1
- data/lib/biryani/window.rb +11 -13
- data/lib/biryani.rb +3 -2
- data/spec/connection/handle_connection_window_update_spec.rb +1 -1
- data/spec/connection/handle_rst_stream_spec.rb +2 -2
- data/spec/connection/handle_settings_spec.rb +8 -2
- data/spec/connection/handle_stream_window_update_spec.rb +2 -2
- data/spec/connection/send_spec.rb +34 -44
- data/spec/connection/transition_state_send_spec.rb +3 -3
- data/spec/data_buffer_spec.rb +43 -43
- data/spec/streams_context_spec.rb +79 -0
- metadata +4 -5
- data/spec/connection/close_all_streams_spec.rb +0 -17
- data/spec/connection/remove_closed_streams_spec.rb +0 -51
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: biryani
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thekuwayama
|
|
@@ -75,16 +75,15 @@ files:
|
|
|
75
75
|
- lib/biryani/stream.rb
|
|
76
76
|
- lib/biryani/stream_error.rb
|
|
77
77
|
- lib/biryani/streams_context.rb
|
|
78
|
+
- lib/biryani/utils.rb
|
|
78
79
|
- lib/biryani/version.rb
|
|
79
80
|
- lib/biryani/window.rb
|
|
80
|
-
- spec/connection/close_all_streams_spec.rb
|
|
81
81
|
- spec/connection/handle_connection_window_update_spec.rb
|
|
82
82
|
- spec/connection/handle_ping_spec.rb
|
|
83
83
|
- spec/connection/handle_rst_stream_spec.rb
|
|
84
84
|
- spec/connection/handle_settings_spec.rb
|
|
85
85
|
- spec/connection/handle_stream_window_update_spec.rb
|
|
86
86
|
- spec/connection/read_http2_magic_spec.rb
|
|
87
|
-
- spec/connection/remove_closed_streams_spec.rb
|
|
88
87
|
- spec/connection/send_spec.rb
|
|
89
88
|
- spec/connection/transition_state_send_spec.rb
|
|
90
89
|
- spec/connection/unwrap_spec.rb
|
|
@@ -109,6 +108,7 @@ files:
|
|
|
109
108
|
- spec/hpack/string_spec.rb
|
|
110
109
|
- spec/http_request_builder_spec.rb
|
|
111
110
|
- spec/spec_helper.rb
|
|
111
|
+
- spec/streams_context_spec.rb
|
|
112
112
|
homepage: https://github.com/thekuwayama/biryani
|
|
113
113
|
licenses:
|
|
114
114
|
- MIT
|
|
@@ -131,14 +131,12 @@ rubygems_version: 4.0.3
|
|
|
131
131
|
specification_version: 4
|
|
132
132
|
summary: An HTTP/2 server implemented using Ruby Ractor
|
|
133
133
|
test_files:
|
|
134
|
-
- spec/connection/close_all_streams_spec.rb
|
|
135
134
|
- spec/connection/handle_connection_window_update_spec.rb
|
|
136
135
|
- spec/connection/handle_ping_spec.rb
|
|
137
136
|
- spec/connection/handle_rst_stream_spec.rb
|
|
138
137
|
- spec/connection/handle_settings_spec.rb
|
|
139
138
|
- spec/connection/handle_stream_window_update_spec.rb
|
|
140
139
|
- spec/connection/read_http2_magic_spec.rb
|
|
141
|
-
- spec/connection/remove_closed_streams_spec.rb
|
|
142
140
|
- spec/connection/send_spec.rb
|
|
143
141
|
- spec/connection/transition_state_send_spec.rb
|
|
144
142
|
- spec/connection/unwrap_spec.rb
|
|
@@ -163,3 +161,4 @@ test_files:
|
|
|
163
161
|
- spec/hpack/string_spec.rb
|
|
164
162
|
- spec/http_request_builder_spec.rb
|
|
165
163
|
- spec/spec_helper.rb
|
|
164
|
+
- spec/streams_context_spec.rb
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
require_relative '../spec_helper'
|
|
2
|
-
|
|
3
|
-
RSpec.describe Connection do
|
|
4
|
-
context 'close_all_streams' do
|
|
5
|
-
let(:streams_ctx) do
|
|
6
|
-
streams_ctx = StreamsContext.new
|
|
7
|
-
streams_ctx.new_context(1, do_nothing_proc)
|
|
8
|
-
streams_ctx.new_context(2, do_nothing_proc)
|
|
9
|
-
streams_ctx
|
|
10
|
-
end
|
|
11
|
-
it 'should close' do
|
|
12
|
-
Connection.close_all_streams(streams_ctx)
|
|
13
|
-
expect { streams_ctx[1].tx << nil }.to raise_error Ractor::ClosedError
|
|
14
|
-
expect { streams_ctx[2].tx << nil }.to raise_error Ractor::ClosedError
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
require_relative '../spec_helper'
|
|
2
|
-
|
|
3
|
-
RSpec.describe Connection do
|
|
4
|
-
context 'remove_closed_streams' do
|
|
5
|
-
let(:streams_ctx1) do
|
|
6
|
-
streams_ctx = StreamsContext.new
|
|
7
|
-
streams_ctx.new_context(1, do_nothing_proc)
|
|
8
|
-
streams_ctx.new_context(2, do_nothing_proc)
|
|
9
|
-
streams_ctx
|
|
10
|
-
end
|
|
11
|
-
let(:data_buffer1) do
|
|
12
|
-
DataBuffer.new
|
|
13
|
-
end
|
|
14
|
-
it 'should close' do
|
|
15
|
-
Connection.remove_closed_streams(streams_ctx1, data_buffer1)
|
|
16
|
-
expect(streams_ctx1.length).to eq 2
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
let(:streams_ctx2) do
|
|
20
|
-
streams_ctx = StreamsContext.new
|
|
21
|
-
streams_ctx.new_context(1, do_nothing_proc)
|
|
22
|
-
streams_ctx.new_context(2, do_nothing_proc)
|
|
23
|
-
streams_ctx[2].state.close
|
|
24
|
-
streams_ctx
|
|
25
|
-
end
|
|
26
|
-
let(:data_buffer2) do
|
|
27
|
-
DataBuffer.new
|
|
28
|
-
end
|
|
29
|
-
it 'should close' do
|
|
30
|
-
Connection.remove_closed_streams(streams_ctx2, data_buffer2)
|
|
31
|
-
expect(streams_ctx2.length).to eq 2 # remain stream_id
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
let(:streams_ctx3) do
|
|
35
|
-
streams_ctx = StreamsContext.new
|
|
36
|
-
streams_ctx.new_context(1, do_nothing_proc)
|
|
37
|
-
streams_ctx.new_context(2, do_nothing_proc)
|
|
38
|
-
streams_ctx[2].state.close
|
|
39
|
-
streams_ctx
|
|
40
|
-
end
|
|
41
|
-
let(:data_buffer3) do
|
|
42
|
-
data_buffer = DataBuffer.new
|
|
43
|
-
data_buffer << Frame::Data.new(false, 2, 'two', nil)
|
|
44
|
-
data_buffer
|
|
45
|
-
end
|
|
46
|
-
it 'should close' do
|
|
47
|
-
Connection.remove_closed_streams(streams_ctx3, data_buffer3)
|
|
48
|
-
expect(streams_ctx3.length).to eq 2
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|