1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Convert thread pool sizes to integers

This commit is contained in:
Larry Marburger 2013-07-16 20:07:59 -04:00
parent 228edd90e0
commit 26c961f1db
2 changed files with 13 additions and 3 deletions

View file

@ -20,8 +20,8 @@ module Puma
@spawned = 0
@waiting = 0
@min = min
@max = max
@min = Integer(min)
@max = Integer(max)
@block = block
@extra = extra
@ -34,7 +34,7 @@ module Puma
@auto_trim = nil
@mutex.synchronize do
min.times { spawn_thread }
@min.times { spawn_thread }
end
end

View file

@ -32,6 +32,16 @@ class TestThreadPool < Test::Unit::TestCase
assert_equal 1, pool.spawned
end
def test_converts_pool_sizes
pool = new_pool('0', '1')
assert_equal 0, pool.spawned
pool << 1
assert_equal 1, pool.spawned
end
def test_append_queues_on_max
finish = false
pool = new_pool(0, 1) { Thread.pass until finish }