module Birdwatcher::Concerns::Concurrency

Constants

DEFAULT_THREAD_POOL_SIZE

The default size of thread pool @private

Public Class Methods

included(base) click to toggle source
# File lib/birdwatcher/concerns/concurrency.rb, line 8
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

thread_pool(size = nil) click to toggle source

Create a new thread pool

@param size [Integer] OPTIONAL: The size of the thread pool (default size if not specified) @return [Thread::Pool] @see github.com/meh/ruby-thread#pool

# File lib/birdwatcher/concerns/concurrency.rb, line 20
def thread_pool(size = nil)
  Thread.pool(size || DEFAULT_THREAD_POOL_SIZE)
end