Sha256: 8e3e7c584099bc9224ea1b5fd0cc71433634ef7e81a0bcfd41d60ff817664a94

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

require 'concurrent/executor/ruby_thread_pool_executor'

module Concurrent

  # @!macro fixed_thread_pool
  # @!macro thread_pool_options
  # @!macro thread_pool_executor_public_api
  # @!visibility private
  class RubyFixedThreadPool < RubyThreadPoolExecutor

    # @!macro fixed_thread_pool_method_initialize
    def initialize(num_threads, opts = {})
      raise ArgumentError.new('number of threads must be greater than zero') if num_threads.to_i < 1
      defaults  = { max_queue:   DEFAULT_MAX_QUEUE_SIZE,
                    idletime:    DEFAULT_THREAD_IDLETIMEOUT }
      overrides = { min_threads: num_threads,
                    max_threads: num_threads }
      super(defaults.merge(opts).merge(overrides))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
concurrent-ruby-0.9.0.pre2 lib/concurrent/executor/ruby_fixed_thread_pool.rb
concurrent-ruby-0.9.0.pre2-java lib/concurrent/executor/ruby_fixed_thread_pool.rb