Class: BundleUpdateInteractive::ThreadPool

Inherits:
Object
  • Object
show all
Includes:
Concurrent::Promises::FactoryMethods
Defined in:
lib/bundle_update_interactive/thread_pool.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_threads:) ⇒ ThreadPool

Returns a new instance of ThreadPool.



9
10
11
12
13
14
15
# File 'lib/bundle_update_interactive/thread_pool.rb', line 9

def initialize(max_threads:)
  @executor = Concurrent::ThreadPoolExecutor.new(
    min_threads: 0,
    max_threads: max_threads,
    max_queue: 0
  )
end

Instance Method Details

#default_executorObject



17
18
19
# File 'lib/bundle_update_interactive/thread_pool.rb', line 17

def default_executor
  @executor
end