From d385da49ef6c17c64cf8be66002f5744c1ee38f7 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 23 Oct 2012 03:50:52 -0700 Subject: patched supply_drop gem and vendored it --- vendor/supply_drop/lib/supply_drop/util.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 vendor/supply_drop/lib/supply_drop/util.rb (limited to 'vendor/supply_drop/lib/supply_drop/util.rb') diff --git a/vendor/supply_drop/lib/supply_drop/util.rb b/vendor/supply_drop/lib/supply_drop/util.rb new file mode 100644 index 0000000..5f4f9f4 --- /dev/null +++ b/vendor/supply_drop/lib/supply_drop/util.rb @@ -0,0 +1,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 -- cgit v1.2.3