• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-concurrency / concurrent-ruby / #2743

04 Mar 2015 02:59AM UTC coverage: 45.152% (-50.4%) from 95.548%
#2743

push

jdantonio
Merge pull request #258 from ruby-concurrency/clock_time

Closes #256

23 of 69 new or added lines in 7 files covered. (33.33%)

1563 existing lines in 88 files now uncovered.

1425 of 3156 relevant lines covered (45.15%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

44.44
/lib/concurrent/executor/ruby_fixed_thread_pool.rb
1
require 'concurrent/executor/ruby_thread_pool_executor'
1✔
2

3
module Concurrent
1✔
4

5
  # @!macro fixed_thread_pool
6
  class RubyFixedThreadPool < RubyThreadPoolExecutor
1✔
7

8
    # Create a new thread pool.
9
    #
10
    # @param [Integer] num_threads the number of threads to allocate
11
    # @param [Hash] opts the options defining pool behavior.
12
    # @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy
13
    #
14
    # @raise [ArgumentError] if `num_threads` is less than or equal to zero
15
    # @raise [ArgumentError] if `fallback_policy` is not a known policy
16
    def initialize(num_threads, opts = {})
1✔
UNCOV
17
      fallback_policy = opts.fetch(:fallback_policy, opts.fetch(:overflow_policy, :abort))
×
18

UNCOV
19
      raise ArgumentError.new('number of threads must be greater than zero') if num_threads < 1
×
UNCOV
20
      raise ArgumentError.new("#{fallback_policy} is not a valid fallback policy") unless FALLBACK_POLICIES.include?(fallback_policy)
×
21

22
      opts = {
UNCOV
23
        min_threads: num_threads,
×
24
        max_threads: num_threads,
25
        fallback_policy: fallback_policy,
26
        max_queue: DEFAULT_MAX_QUEUE_SIZE,
27
        idletime: DEFAULT_THREAD_IDLETIMEOUT,
28
      }.merge(opts)
UNCOV
29
      super(opts)
×
30
    end
31
  end
32
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc