hot_tub 0.3.0 → 0.4.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 +5 -13
- data/.travis.yml +6 -9
- data/HISTORY.md +8 -1
- data/LICENSE.txt +1 -1
- data/README.md +11 -23
- data/benchmarks/hot_tub.rb +116 -0
- data/hot_tub.gemspec +3 -1
- data/lib/hot_tub/known_clients.rb +6 -4
- data/lib/hot_tub/pool.rb +65 -61
- data/lib/hot_tub/reaper.rb +14 -5
- data/lib/hot_tub/sessions.rb +33 -60
- data/lib/hot_tub/version.rb +1 -1
- data/lib/hot_tub.rb +3 -2
- data/spec/helpers/moc_pool.rb +1 -0
- data/spec/helpers/server.rb +16 -14
- data/spec/hot_tub/integration/excon_spec.rb +139 -0
- data/spec/hot_tub/integration/net_http_spec.rb +104 -0
- data/spec/hot_tub/integration/sessions_spec.rb +40 -0
- data/spec/hot_tub/pool_spec.rb +247 -0
- data/spec/{reaper_mixin_spec.rb → hot_tub/reaper_mixin_spec.rb} +7 -8
- data/spec/hot_tub/reaper_spec.rb +27 -0
- data/spec/hot_tub/sessions_spec.rb +137 -0
- data/spec/hot_tub_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -3
- metadata +63 -28
- data/spec/pool_spec.rb +0 -386
- data/spec/reaper_spec.rb +0 -28
- data/spec/sessions_spec.rb +0 -223
@@ -0,0 +1,247 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe HotTub::Pool do
|
3
|
+
|
4
|
+
context 'default settings' do
|
5
|
+
let(:pool) { HotTub::Pool.new { MocClient.new } }
|
6
|
+
|
7
|
+
it "should have :size of 5" do
|
8
|
+
expect(pool.instance_variable_get(:@size)).to eql(5)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should have :wait_timeout of 0.5" do
|
12
|
+
expect(pool.instance_variable_get(:@wait_timeout)).to eql(10)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have set the client" do
|
16
|
+
expect(pool.instance_variable_get(:@new_client).call).to be_a(MocClient)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should be true" do
|
20
|
+
expect(pool.instance_variable_get(:@max_size)).to eql(0)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should have a HotTub::Reaper" do
|
24
|
+
expect(pool.reaper).to be_a(Thread)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'custom settings' do
|
29
|
+
|
30
|
+
let(:pool) { HotTub::Pool.new(:size => 10, :wait_timeout => 1.0, :max_size => 20) { MocClient.new } }
|
31
|
+
|
32
|
+
it { expect(pool.instance_variable_get(:@size)).to eql(10) }
|
33
|
+
|
34
|
+
it { expect(pool.instance_variable_get(:@wait_timeout)).to eql(1.0) }
|
35
|
+
|
36
|
+
it { expect(pool.instance_variable_get(:@max_size)).to eql(20) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#run' do
|
40
|
+
let(:pool) { HotTub::Pool.new { MocClient.new} }
|
41
|
+
|
42
|
+
it "should remove connection from pool when doing work" do
|
43
|
+
pool.run do |connection|
|
44
|
+
conn = connection
|
45
|
+
expect(pool.instance_variable_get(:@_pool).select{|c| c.object_id == conn.object_id}.length).to eql(0)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should return the connection after use" do
|
50
|
+
conn = nil
|
51
|
+
pool.run do |connection|
|
52
|
+
conn = connection
|
53
|
+
end
|
54
|
+
# returned to pool after work was done
|
55
|
+
expect(pool.instance_variable_get(:@_pool).pop).to eql(conn)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should work" do
|
59
|
+
result = nil
|
60
|
+
pool.run{|clnt| result = clnt.get}
|
61
|
+
expect(result).to_not be_nil
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'block not given' do
|
65
|
+
it "should raise ArgumentError" do
|
66
|
+
expect { pool.run }.to raise_error(ArgumentError)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe ':max_size option' do
|
72
|
+
|
73
|
+
context 'is default' do
|
74
|
+
it "should add clients to pool as necessary" do
|
75
|
+
pool = HotTub::Pool.new({:size => 1}) { MocClient.new }
|
76
|
+
threads = []
|
77
|
+
5.times.each do
|
78
|
+
threads << Thread.new do
|
79
|
+
pool.run{|cltn| cltn.get }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
threads.each do |t|
|
83
|
+
t.join
|
84
|
+
end
|
85
|
+
expect(pool.send(:_total_current_size)).to be > 1
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'is set' do
|
90
|
+
it "should not add clients to pool beyond specified size" do
|
91
|
+
pool = HotTub::Pool.new({:size => 1, :max_size => 1, :wait_timeout => 100}) { MocClient.new }
|
92
|
+
threads = []
|
93
|
+
5.times.each do
|
94
|
+
threads << Thread.new do
|
95
|
+
pool.run{|cltn| cltn.get }
|
96
|
+
end
|
97
|
+
end
|
98
|
+
threads.each do |t|
|
99
|
+
t.join
|
100
|
+
end
|
101
|
+
expect(pool.send(:_total_current_size)).to eql(1)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe '#drain!' do
|
107
|
+
let(:pool) { HotTub::Pool.new(:size => 4) { MocClient.new } }
|
108
|
+
before(:each) do
|
109
|
+
pool.instance_variable_set(:@_out, [MocClient.new,MocClient.new,MocClient.new])
|
110
|
+
pool.instance_variable_set(:@_pool, [MocClient.new,MocClient.new,MocClient.new])
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
it "should drain pool" do
|
115
|
+
pool.drain!
|
116
|
+
expect(pool.instance_variable_get(:@_pool).length).to eql(0)
|
117
|
+
expect(pool.instance_variable_get(:@_out).length).to eql(0)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#reset!' do
|
122
|
+
let(:pool) { HotTub::Pool.new(:size => 4, :close => :close) { MocClient.new } }
|
123
|
+
let(:client) { MocClient.new }
|
124
|
+
|
125
|
+
before(:each) do
|
126
|
+
pool.instance_variable_set(:@_out, [client,MocClient.new,MocClient.new])
|
127
|
+
pool.instance_variable_set(:@_pool, [MocClient.new,MocClient.new,MocClient.new])
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should reset pool" do
|
131
|
+
pool.reset!
|
132
|
+
expect(client).to be_closed
|
133
|
+
expect(pool.instance_variable_get(:@_pool).length).to eql(0)
|
134
|
+
expect(pool.instance_variable_get(:@_out).length).to eql(0)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
describe '#clean!' do
|
139
|
+
let(:pool) { HotTub::Pool.new(:size => 3, :clean => lambda { |clnt| clnt.clean}) { MocClient.new } }
|
140
|
+
|
141
|
+
it "should clean pool" do
|
142
|
+
pool.instance_variable_set(:@_pool, [MocClient.new,MocClient.new,MocClient.new])
|
143
|
+
expect(pool.instance_variable_get(:@_pool).first).to_not be_cleaned
|
144
|
+
pool.clean!
|
145
|
+
pool.instance_variable_get(:@_pool).each do |clnt|
|
146
|
+
expect(clnt).to be_cleaned
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
describe '#shutdown!' do
|
152
|
+
let(:pool) { HotTub::Pool.new(:size => 4) { MocClient.new } }
|
153
|
+
|
154
|
+
it "should kill reaper" do
|
155
|
+
pool.shutdown!
|
156
|
+
sleep(0.01)
|
157
|
+
expect(pool.instance_variable_get(:@reaper)).to be_nil
|
158
|
+
end
|
159
|
+
|
160
|
+
it "should shutdown pool" do
|
161
|
+
pool.instance_variable_set(:@_pool, [MocClient.new,MocClient.new,MocClient.new])
|
162
|
+
pool.shutdown!
|
163
|
+
expect(pool.instance_variable_get(:@_pool).length).to eql(0)
|
164
|
+
expect(pool.send(:_total_current_size)).to eql(0)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
describe '#reap!' do
|
169
|
+
it "should clients from the pool" do
|
170
|
+
pool = HotTub::Pool.new({ :size => 1, :close => :close }) { MocClient.new }
|
171
|
+
old_client = MocClient.new
|
172
|
+
pool.instance_variable_set(:@last_activity,(Time.now - 601))
|
173
|
+
pool.instance_variable_set(:@_pool, [old_client, MocClient.new, MocClient.new])
|
174
|
+
pool.reap!
|
175
|
+
expect(pool.current_size).to eql(1)
|
176
|
+
expect(old_client).to be_closed
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
context 'private methods' do
|
181
|
+
let(:pool) { HotTub::Pool.new { MocClient.new} }
|
182
|
+
|
183
|
+
describe '#client' do
|
184
|
+
it "should raise HotTub::BlockingTimeout if an available is not found in time"do
|
185
|
+
pool.instance_variable_set(:@non_blocking,false)
|
186
|
+
pool.instance_variable_set(:@wait_timeout, 0.1)
|
187
|
+
allow(pool).to receive(:raise_alarm?).and_return(true)
|
188
|
+
expect { puts pool.send(:pop) }.to raise_error(HotTub::Pool::Timeout)
|
189
|
+
end
|
190
|
+
|
191
|
+
it "should return an instance of the client" do
|
192
|
+
expect(pool.send(:client)).to be_instance_of(MocClient)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe '#pop' do
|
197
|
+
context "is allowed" do
|
198
|
+
it "should work" do
|
199
|
+
expect(pool.send(:pop)).to be_a(MocClient)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
describe '#push' do
|
205
|
+
context "client is registered" do
|
206
|
+
it "should push client back to pool" do
|
207
|
+
clnt = pool.send(:pop)
|
208
|
+
pool.send(:push,clnt)
|
209
|
+
expect(pool.instance_variable_get(:@_pool).include?(clnt)).to eql(true)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
context "client is not registered" do
|
213
|
+
it "should push client back to pool" do
|
214
|
+
clnt = pool.send(:pop)
|
215
|
+
pool.instance_variable_get(:@_out).delete(clnt)
|
216
|
+
pool.send(:push,clnt)
|
217
|
+
expect(pool.instance_variable_get(:@_pool).include?(clnt)).to eql(false)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
context "client is nil" do
|
221
|
+
it "should not push client back to pool" do
|
222
|
+
pool.send(:push,nil)
|
223
|
+
expect(pool.instance_variable_get(:@_pool).include?(nil)).to eql(false)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
context 'thread safety' do
|
230
|
+
it "should grow" do
|
231
|
+
pool = HotTub::Pool.new({:size => 4}) { MocClient.new }
|
232
|
+
failed = false
|
233
|
+
expect {
|
234
|
+
threads = []
|
235
|
+
20.times.each do
|
236
|
+
threads << Thread.new do
|
237
|
+
pool.run{|connection| connection.get }
|
238
|
+
end
|
239
|
+
end
|
240
|
+
threads.each do |t|
|
241
|
+
t.join
|
242
|
+
end
|
243
|
+
}.to_not raise_error
|
244
|
+
expect(pool.current_size).to be >= 4
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
@@ -1,29 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
describe HotTub::Reaper::Mixin do
|
3
|
-
|
4
|
-
|
5
|
-
end
|
3
|
+
let(:pool) { MocMixinPool.new }
|
4
|
+
|
6
5
|
describe '#reaper' do
|
7
6
|
it "should be defined" do
|
8
|
-
|
7
|
+
expect(pool).to respond_to(:reaper)
|
9
8
|
end
|
10
9
|
end
|
11
10
|
describe '#reap_timeout' do
|
12
11
|
it "should be defined" do
|
13
|
-
|
12
|
+
expect(pool).to respond_to(:reap_timeout)
|
14
13
|
end
|
15
14
|
end
|
16
15
|
describe '#shutdown' do
|
17
16
|
it "should be defined" do
|
18
|
-
|
17
|
+
expect(pool).to respond_to(:shutdown)
|
19
18
|
end
|
20
19
|
end
|
21
20
|
describe '#reap!' do
|
22
21
|
it "should be defined" do
|
23
|
-
|
22
|
+
expect(pool).to respond_to(:reap!)
|
24
23
|
end
|
25
24
|
it "should raise NoMethodError if called" do
|
26
|
-
|
25
|
+
expect { pool.reap! }.to raise_error(NoMethodError)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotTub::Reaper do
|
4
|
+
|
5
|
+
let(:pool) { MocReaperPool.new }
|
6
|
+
let(:reaper) { pool.reaper }
|
7
|
+
|
8
|
+
it "should be a HotTub::Reaper Thread" do
|
9
|
+
expect(reaper).to be_a(Thread)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should reap!" do
|
13
|
+
expect(pool.reaped).to eql(false)
|
14
|
+
pool.lets_reap = true
|
15
|
+
reaper.wakeup
|
16
|
+
sleep(0.01)
|
17
|
+
expect(pool.reaped).to eql(true)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should sleep after reap!" do
|
21
|
+
expect(pool.reaped).to eql(false)
|
22
|
+
pool.lets_reap = true
|
23
|
+
reaper.wakeup
|
24
|
+
sleep(0.01)
|
25
|
+
expect(reaper.status).to eql('sleep')
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'hot_tub/sessions'
|
3
|
+
require 'uri'
|
4
|
+
require 'time'
|
5
|
+
describe HotTub::Sessions do
|
6
|
+
|
7
|
+
context 'initialized without a block' do
|
8
|
+
it "should raise error if block is not supplied" do
|
9
|
+
expect { HotTub::Sessions.new }.to raise_error(ArgumentError)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'initialized with a block' do
|
14
|
+
|
15
|
+
let(:url) { "https://www.somewebsite.com" }
|
16
|
+
let(:uri) { URI(url) }
|
17
|
+
|
18
|
+
let(:sessions) { HotTub::Sessions.new { |url| MocClient.new(url) } }
|
19
|
+
|
20
|
+
|
21
|
+
describe '#to_url' do
|
22
|
+
context "passed URL string" do
|
23
|
+
it "should return key with URI scheme-domain" do
|
24
|
+
expect(sessions.send(:to_key,url)).to eql("#{uri.scheme}://#{uri.host}:#{uri.port}")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "passed URI" do
|
29
|
+
it "should return key with URI scheme-domain" do
|
30
|
+
expect(sessions.send(:to_key,uri)).to eql("#{uri.scheme}://#{uri.host}:#{uri.port}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "invalid argument" do
|
35
|
+
it "should raise an ArgumentError" do
|
36
|
+
expect { sessions.send(:to_key, nil) }.to raise_error(ArgumentError)
|
37
|
+
end
|
38
|
+
it "should raise URI::InvalidURIError with bad url" do
|
39
|
+
expect { sessions.send(:to_key,"bad url") }.to raise_error(URI::InvalidURIError)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '#sessions' do
|
45
|
+
context 'HotTub::Pool as client' do
|
46
|
+
it "should add a new client for the url" do
|
47
|
+
with_pool_options = HotTub::Sessions.new { |url| HotTub::Pool.new(:size => 13) { MocClient.new(url) } }
|
48
|
+
with_pool_options.sessions(url)
|
49
|
+
sessions = with_pool_options.instance_variable_get(:@sessions)
|
50
|
+
expect(sessions.size).to eql(1)
|
51
|
+
sessions.each_value {|v| expect(v).to be_a( HotTub::Pool)}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
context "passed URL string" do
|
55
|
+
it "should set key with URI scheme-domain" do
|
56
|
+
sessions.sessions(url)
|
57
|
+
sns = sessions.instance_variable_get(:@sessions)
|
58
|
+
expect(sns["#{uri.scheme}://#{uri.host}:#{uri.port}"]).to be_a(HotTub::Pool)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
context "passed URI" do
|
62
|
+
it "should set key with URI scheme-domain" do
|
63
|
+
sessions.sessions(uri)
|
64
|
+
sns = sessions.instance_variable_get(:@sessions)
|
65
|
+
expect(sns["#{uri.scheme}://#{uri.host}:#{uri.port}"]).to be_a(HotTub::Pool)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#run' do
|
72
|
+
it "should pass run to pool" do
|
73
|
+
url = HotTub::Server.url
|
74
|
+
session_with_pool = HotTub::Sessions.new({:with_pool => true}) { |url|
|
75
|
+
uri = URI.parse(url)
|
76
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
77
|
+
http.use_ssl = false
|
78
|
+
http.start
|
79
|
+
http
|
80
|
+
}
|
81
|
+
result = nil
|
82
|
+
session_with_pool.run(url) do |conn|
|
83
|
+
uri = URI.parse(url)
|
84
|
+
result = conn.get(uri.path).code
|
85
|
+
end
|
86
|
+
expect(result).to eql('200')
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#clean!' do
|
91
|
+
it "should clean all pools in sessions" do
|
92
|
+
sessions = HotTub::Sessions.new(:with_pool => true, :clean => lambda { |clnt| clnt.clean}) { |url| MocClient.new(url) }
|
93
|
+
sessions.sessions('foo')
|
94
|
+
sessions.sessions('bar')
|
95
|
+
sessions.clean!
|
96
|
+
sessions.instance_variable_get(:@sessions).each_pair do |k,v|
|
97
|
+
v.instance_variable_get(:@_pool).each do |c|
|
98
|
+
expect(c).to be_cleaned
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe '#drain!' do
|
105
|
+
it "should drain all pools in sessions" do
|
106
|
+
sessions = HotTub::Sessions.new(:with_pool => true) { |url| MocClient.new(url) }
|
107
|
+
sessions.sessions('foo')
|
108
|
+
sessions.sessions('bar')
|
109
|
+
sessions.drain!
|
110
|
+
expect(sessions.instance_variable_get(:@sessions)).to_not be_empty
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe '#reap!' do
|
115
|
+
it "should clean all pools in sessions" do
|
116
|
+
sessions = HotTub::Sessions.new(:with_pool => true, :reap => lambda { |clnt| clnt.reap}) { |url| MocClient.new(url) }
|
117
|
+
sessions.sessions('foo')
|
118
|
+
sessions.sessions('bar')
|
119
|
+
sessions.reap!
|
120
|
+
sessions.instance_variable_get(:@sessions).each_pair do |k,v|
|
121
|
+
v.instance_variable_get(:@_pool).each do |c|
|
122
|
+
expect(c).to be_reaped
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '#reset!' do
|
129
|
+
it "should reset all pools in sessions" do
|
130
|
+
sessions = HotTub::Sessions.new(:with_pool => true) { |url| MocClient.new(url) }
|
131
|
+
sessions.sessions('foo')
|
132
|
+
sessions.sessions('bar')
|
133
|
+
sessions.reset!
|
134
|
+
expect(sessions.instance_variable_get(:@sessions)).to be_empty
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
data/spec/hot_tub_spec.rb
CHANGED
@@ -5,14 +5,14 @@ describe HotTub do
|
|
5
5
|
describe '#new' do
|
6
6
|
|
7
7
|
it "should return a HotTub::Pool" do
|
8
|
-
(HotTub.new { |url| MocClient.new(url) }).
|
8
|
+
expect(HotTub.new { |url| MocClient.new(url) }).to be_a(HotTub::Pool)
|
9
9
|
end
|
10
10
|
|
11
11
|
context ':sessions => true' do
|
12
12
|
it "should be a HotTub::Sessions with HotTub::Pool as client" do
|
13
13
|
session_with_pool = HotTub.new(:sessions => true) { |url| MocClient.new(url) }
|
14
14
|
pool = session_with_pool.sessions("http://test.com")
|
15
|
-
pool.
|
15
|
+
expect(pool).to be_a(HotTub::Pool)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,7 @@ require 'helpers/moc_pool'
|
|
7
7
|
require 'helpers/moc_client'
|
8
8
|
require 'helpers/server'
|
9
9
|
require 'net/https'
|
10
|
+
|
10
11
|
unless HotTub.jruby? || HotTub.rbx?
|
11
12
|
require 'coveralls'
|
12
13
|
Coveralls.wear!
|
@@ -14,9 +15,8 @@ end
|
|
14
15
|
|
15
16
|
# Requires supporting files with custom matchers and macros, etc,
|
16
17
|
# in ./support/ and its subdirectories.
|
17
|
-
#Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
18
|
-
HotTub.logger
|
19
|
-
|
18
|
+
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
19
|
+
# HotTub.logger = Logger.new(STDOUT)
|
20
20
|
RSpec.configure do |config|
|
21
21
|
config.before(:suite) do
|
22
22
|
HotTub::Server.run
|
metadata
CHANGED
@@ -1,83 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot_tub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Mckinney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thread_safe
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-autotest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: autotest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: sinatra
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
|
-
- -
|
73
|
+
- - ">="
|
46
74
|
- !ruby/object:Gem::Version
|
47
75
|
version: '0'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- -
|
80
|
+
- - ">="
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: puma
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
|
-
- - ~>
|
87
|
+
- - "~>"
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.0
|
89
|
+
version: '2.0'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- - ~>
|
94
|
+
- - "~>"
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0
|
96
|
+
version: '2.0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: excon
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
|
-
- -
|
101
|
+
- - ">="
|
74
102
|
- !ruby/object:Gem::Version
|
75
103
|
version: '0'
|
76
104
|
type: :development
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
|
-
- -
|
108
|
+
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
83
111
|
description: A dynamic thread-safe pooling gem, when you need more than a standard
|
@@ -88,14 +116,15 @@ executables: []
|
|
88
116
|
extensions: []
|
89
117
|
extra_rdoc_files: []
|
90
118
|
files:
|
91
|
-
- .gitignore
|
92
|
-
- .rspec
|
93
|
-
- .travis.yml
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".travis.yml"
|
94
122
|
- Gemfile
|
95
123
|
- HISTORY.md
|
96
124
|
- LICENSE.txt
|
97
125
|
- README.md
|
98
126
|
- Rakefile
|
127
|
+
- benchmarks/hot_tub.rb
|
99
128
|
- hot_tub.gemspec
|
100
129
|
- lib/hot_tub.rb
|
101
130
|
- lib/hot_tub/known_clients.rb
|
@@ -106,11 +135,14 @@ files:
|
|
106
135
|
- spec/helpers/moc_client.rb
|
107
136
|
- spec/helpers/moc_pool.rb
|
108
137
|
- spec/helpers/server.rb
|
138
|
+
- spec/hot_tub/integration/excon_spec.rb
|
139
|
+
- spec/hot_tub/integration/net_http_spec.rb
|
140
|
+
- spec/hot_tub/integration/sessions_spec.rb
|
141
|
+
- spec/hot_tub/pool_spec.rb
|
142
|
+
- spec/hot_tub/reaper_mixin_spec.rb
|
143
|
+
- spec/hot_tub/reaper_spec.rb
|
144
|
+
- spec/hot_tub/sessions_spec.rb
|
109
145
|
- spec/hot_tub_spec.rb
|
110
|
-
- spec/pool_spec.rb
|
111
|
-
- spec/reaper_mixin_spec.rb
|
112
|
-
- spec/reaper_spec.rb
|
113
|
-
- spec/sessions_spec.rb
|
114
146
|
- spec/spec_helper.rb
|
115
147
|
homepage: https://github.com/JoshMcKin/hot_tub
|
116
148
|
licenses:
|
@@ -122,17 +154,17 @@ require_paths:
|
|
122
154
|
- lib
|
123
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
156
|
requirements:
|
125
|
-
- -
|
157
|
+
- - ">="
|
126
158
|
- !ruby/object:Gem::Version
|
127
159
|
version: '0'
|
128
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
161
|
requirements:
|
130
|
-
- -
|
162
|
+
- - ">="
|
131
163
|
- !ruby/object:Gem::Version
|
132
164
|
version: '0'
|
133
165
|
requirements: []
|
134
166
|
rubyforge_project: hot_tub
|
135
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.4.8
|
136
168
|
signing_key:
|
137
169
|
specification_version: 4
|
138
170
|
summary: A dynamic thread-safe pooling gem.
|
@@ -140,9 +172,12 @@ test_files:
|
|
140
172
|
- spec/helpers/moc_client.rb
|
141
173
|
- spec/helpers/moc_pool.rb
|
142
174
|
- spec/helpers/server.rb
|
175
|
+
- spec/hot_tub/integration/excon_spec.rb
|
176
|
+
- spec/hot_tub/integration/net_http_spec.rb
|
177
|
+
- spec/hot_tub/integration/sessions_spec.rb
|
178
|
+
- spec/hot_tub/pool_spec.rb
|
179
|
+
- spec/hot_tub/reaper_mixin_spec.rb
|
180
|
+
- spec/hot_tub/reaper_spec.rb
|
181
|
+
- spec/hot_tub/sessions_spec.rb
|
143
182
|
- spec/hot_tub_spec.rb
|
144
|
-
- spec/pool_spec.rb
|
145
|
-
- spec/reaper_mixin_spec.rb
|
146
|
-
- spec/reaper_spec.rb
|
147
|
-
- spec/sessions_spec.rb
|
148
183
|
- spec/spec_helper.rb
|