Module: H2::Client::Concurrent::ClassMethods

Included in:
H2::Client
Defined in:
lib/h2/client/concurrent.rb

Instance Method Summary collapse

Instance Method Details

#thread_poolObject



9
10
11
12
13
14
15
# File 'lib/h2/client/concurrent.rb', line 9

def thread_pool
  return @thread_pool if @thread_pool
  procs = ::Concurrent.processor_count
  @thread_pool = ::Concurrent::ThreadPoolExecutor.new min_threads: 0,
                                                      max_threads: procs,
                                                      max_queue:   procs * 5
end