module Synapse::Configuration::ThreadPoolDefinitionBuilder

Mixin for a definition builder that creates a service that is backed by a thread pool @see Contender::Pool::ThreadPoolExecutor For pool options

Public Instance Methods

use_pool_options(pool_options) click to toggle source

Sets the options for the thread pool

@param [Hash] pool_options @return [undefined]

# File lib/synapse/configuration/component/shared/thread_pool.rb, line 12
def use_pool_options(pool_options)
  @pool_options = pool_options
end

Protected Instance Methods

create_thread_pool() click to toggle source

Creates a thread pool with the configured options @return [Contender::Pool::ThreadPoolExecutor]

# File lib/synapse/configuration/component/shared/thread_pool.rb, line 20
def create_thread_pool
  pool = Contender::Pool::ThreadPoolExecutor.new @pool_options
  pool.start

  pool
end