Sha256: d867fdc722eef3a5f8d181a3a0ba758610d9db262b71e565ca99d9f810542735

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

if Concurrent.on_jruby?

  require 'concurrent/executor/java_thread_pool_executor'

  module Concurrent

    # @!macro fixed_thread_pool
    # @!macro thread_pool_options
    # @!macro thread_pool_executor_public_api
    # @!visibility private
    class JavaFixedThreadPool < JavaThreadPoolExecutor

      # @!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
end

Version data entries

2 entries across 2 versions & 1 rubygems

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