Class: WaybackArchiver::ThreadPool
- Inherits:
-
Object
- Object
- WaybackArchiver::ThreadPool
- Defined in:
- lib/wayback_archiver/thread_pool.rb
Overview
Thread pool
Class Method Summary collapse
-
.build(concurrency) ⇒ Concurrent::FixedThreadPool/Concurrent::ImmediateExecutor
Build a thread pool.
Class Method Details
.build(concurrency) ⇒ Concurrent::FixedThreadPool/Concurrent::ImmediateExecutor
Build a thread pool
16 17 18 19 20 21 22 23 24 |
# File 'lib/wayback_archiver/thread_pool.rb', line 16 def self.build(concurrency) if concurrency == 1 Concurrent::ImmediateExecutor.new elsif concurrency > 1 Concurrent::FixedThreadPool.new(concurrency) else raise ArgumentError, 'concurrency must be one or greater' end end |