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

jdantonio / concurrent-ruby / #720

06 Apr 2014 10:19PM UTC coverage: 92.699% (-4.6%) from 97.309%
#720

push

chrisseaton
Update README.md

1587 of 1712 relevant lines covered (92.7%)

567.81 hits per line

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

66.67
/lib/concurrent/cached_thread_pool.rb
1
require 'concurrent/ruby_cached_thread_pool'
1✔
2

3
module Concurrent
1✔
4

5
  if RUBY_PLATFORM == 'java'
1✔
6
    require 'concurrent/java_cached_thread_pool'
×
7
    # @!macro [attach] cached_thread_pool
8
    #   A thread pool that dynamically grows and shrinks to fit the current workload.
9
    #   New threads are created as needed, existing threads are reused, and threads
10
    #   that remain idle for too long are killed and removed from the pool. These
11
    #   pools are particularly suited to applications that perform a high volume of
12
    #   short-lived tasks.
13
    #
14
    #   On creation a +CachedThreadPool+ has zero running threads. New threads are
15
    #   created on the pool as new operations are +#post+. The size of the pool
16
    #   will grow until +#max_length+ threads are in the pool or until the number
17
    #   of threads exceeds the number of running and pending operations. When a new
18
    #   operation is post to the pool the first available idle thread will be tasked
19
    #   with the new operation.
20
    #
21
    #   Should a thread crash for any reason the thread will immediately be removed
22
    #   from the pool. Similarly, threads which remain idle for an extended period
23
    #   of time will be killed and reclaimed. Thus these thread pools are very
24
    #   efficient at reclaiming unused resources.
25
    #
26
    #   The API and behavior of this class are based on Java's +CachedThreadPool+
27
    #
28
    #   @note When running on the JVM (JRuby) this class will inherit from +JavaCachedThreadPool+.
29
    #     On all other platforms it will inherit from +RubyCachedThreadPool+.
30
    #
31
    #   @see Concurrent::RubyCachedThreadPool
32
    #   @see Concurrent::JavaCachedThreadPool
33
    #
34
    #   @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html
35
    #   @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html
36
    #   @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html
37
    #   @see http://stackoverflow.com/questions/17957382/fixedthreadpool-vs-cachedthreadpool-the-lesser-of-two-evils
38
    class CachedThreadPool < JavaCachedThreadPool
×
39
    end
40
  else
41
    # @!macro cached_thread_pool
42
    class CachedThreadPool < RubyCachedThreadPool
1✔
43
    end
44
  end
45
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