module Contender

Constants

FIXNUM_MAX

stackoverflow.com/questions/535721/ruby-max-integer

FIXNUM_MIN
VERSION

Public Class Methods

fixed_pool(size, allow_timeout = false) click to toggle source

@param [Integer] size @param [Boolean] allow_timeout @return [PoolExecutor]

# 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
simple_thread_factory() click to toggle source
# File lib/contender.rb, line 50
def self.simple_thread_factory
  SimpleThreadFactory.new
end
single_pool() click to toggle source

@return [PoolExecutor]

# File lib/contender.rb, line 46
def self.single_pool
  fixed_pool 1
end