blob: 5f4f9f4ee6f34d918869d2b39ed5540032cd6374 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
module SupplyDrop
module Util
DEFAULT_THREAD_POOL_SIZE = 10
def self.thread_pool_size
@thread_pool_size ||= DEFAULT_THREAD_POOL_SIZE
end
def self.thread_pool_size=(size)
@thread_pool_size = size
end
def self.optionally_async(collection, async)
if async
async_collection = collection.clone
async_collection.extend SupplyDrop::AsyncEnumerable
async_collection
else
collection
end
end
end
end
|