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:
parent
228edd90e0
commit
26c961f1db
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue