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

jdantonio / concurrent-ruby / #748

24 Apr 2014 12:31AM UTC coverage: 78.31% (-19.5%) from 97.805%
#748

push

jdantonio
Attempting to fix a brittle test of Concurrent::timer.

1928 of 2462 relevant lines covered (78.31%)

409.47 hits per line

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

50.0
/lib/concurrent/executor/ruby_cached_thread_pool.rb
1
require 'concurrent/executor/ruby_thread_pool_executor'
1✔
2

3
module Concurrent
1✔
4

5
  # @!macro cached_thread_pool
6
  class RubyCachedThreadPool < RubyThreadPoolExecutor
1✔
7

8
    # Create a new thread pool.
9
    #
10
    # @param [Hash] opts the options defining pool behavior.
11
    #   number of seconds a thread may be idle before it is reclaimed
12
    #
13
    # @raise [ArgumentError] if `overflow_policy` is not a known policy
14
    def initialize(opts = {})
1✔
15
      overflow_policy = opts.fetch(:overflow_policy, :abort)
×
16

17
      raise ArgumentError.new("#{overflow_policy} is not a valid overflow policy") unless OVERFLOW_POLICIES.include?(overflow_policy)
×
18

19
      opts = opts.merge(
×
20
        min_threads: 0,
21
        max_threads: DEFAULT_MAX_POOL_SIZE,
22
        num_threads: overflow_policy,
23
        max_queue: DEFAULT_MAX_QUEUE_SIZE,
24
        idletime: DEFAULT_THREAD_IDLETIMEOUT
25
      )
26
      super(opts)
×
27
    end
28
  end
29
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