Method: Contender.fixed_pool

Defined in:
lib/contender.rb

.fixed_pool(size, allow_timeout = false) ⇒ PoolExecutor

Parameters:

  • size (Integer)
  • allow_timeout (Boolean) (defaults to: false)

Returns:

  • (PoolExecutor)


34
35
36
37
38
39
40
41
42
43
# File 'lib/contender.rb', line 34

def self.fixed_pool(size, allow_timeout = false)
  executor = Pool::PoolExecutor.new size, size, 0, LinkedQueue.new, simple_thread_factory

  if allow_timeout
    executor.work_timeout = 60
    executor.allow_core_timeout = true
  end

  executor
end