We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67c3beb commit 7bae58bCopy full SHA for 7bae58b
lib/concurrent/executor/ruby_thread_pool_executor.rb
@@ -201,7 +201,7 @@ def ns_kill_execution
201
# tries to assign task to a worker, tries to get one from @ready or to create new one
202
# @return [true, false] if task is assigned to a worker
203
def ns_assign_worker(*args, &task)
204
- worker = @ready.pop || ns_add_busy_worker
+ worker = (@ready.pop if @pool.size >= @min_length) || ns_add_busy_worker
205
if worker
206
worker << [task, args]
207
true
0 commit comments