Module: IronChef::Util

Defined in:
lib/iron_chef/util.rb

Constant Summary collapse

DEFAULT_THREAD_POOL_SIZE =
10

Class Method Summary collapse

Class Method Details

.optionally_async(collection, async) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/iron_chef/util.rb', line 13

def self.optionally_async(collection, async)
  if async
    async_collection = collection.clone
    async_collection.extend IronChef::AsyncEnumerable
    async_collection
  else
    collection
  end
end

.thread_pool_sizeObject



5
6
7
# File 'lib/iron_chef/util.rb', line 5

def self.thread_pool_size
  @thread_pool_size ||= DEFAULT_THREAD_POOL_SIZE
end

.thread_pool_size=(size) ⇒ Object



9
10
11
# File 'lib/iron_chef/util.rb', line 9

def self.thread_pool_size=(size)
  @thread_pool_size = size
end