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

ruby-concurrency / concurrent-ruby / #2835

05 Oct 2014 10:16PM UTC coverage: 45.201% (-49.6%) from 94.81%
#2835

push

jdantonio
Merge pull request #158 from obrok/promise-composition

Promise composition

2 of 15 new or added lines in 1 file covered. (13.33%)

1514 existing lines in 84 files now uncovered.

1375 of 3042 relevant lines covered (45.2%)

0.66 hits per line

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

71.43
/lib/concurrent/options_parser.rb
1
module Concurrent
1✔
2

3
  # A mixin module for parsing options hashes related to gem-level configuration.
4
  module OptionsParser
1✔
5

6
    # Get the requested `Executor` based on the values set in the options hash.
7
    #
8
    # @param [Hash] opts the options defining the requested executor
9
    # @option opts [Executor] :executor (`nil`) when set use the given `Executor` instance
10
    # @option opts [Boolean] :operation (`false`) when true use the global operation pool
11
    # @option opts [Boolean] :task (`true`) when true use the global task pool
12
    #
13
    # @return [Executor, nil] the requested thread pool, or nil when no option specified
14
    def get_executor_from(opts = {})
1✔
15
      if opts[:executor]
1✔
UNCOV
16
        opts[:executor]
×
17
      elsif opts[:operation] == true || opts[:task] == false
1✔
UNCOV
18
        Concurrent.configuration.global_operation_pool
×
19
      elsif opts[:operation] == false || opts[:task] == true
1✔
UNCOV
20
        Concurrent.configuration.global_task_pool
×
21
      else
22
        nil
23
      end
24
    end
25

26
    # Get the requested `Executor` based on the values set in the options hash.
27
    #
28
    # @param [Hash] opts the options defining the requested executor
29
    # @option opts [Executor] :task_executor (`nil`) when set use the given `Executor` instance
30
    #
31
    # @return [Executor] the requested thread pool (default: global task pool)
32
    def get_task_executor_from(opts = {})
1✔
33
      opts[:task_executor] || opts[:executor] || Concurrent.configuration.global_task_pool
6✔
34
    end
35

36
    # Get the requested `Executor` based on the values set in the options hash.
37
    #
38
    # @param [Hash] opts the options defining the requested executor
39
    # @option opts [Executor] :task_executor (`nil`) when set use the given `Executor` instance
40
    #
41
    # @return [Executor] the requested thread pool (default: global operation pool)
42
    def get_operation_executor_from(opts = {})
1✔
UNCOV
43
      opts[:operation_executor] || opts[:executor] || Concurrent.configuration.global_operation_pool
×
44
    end
45

46
    extend self
1✔
47
  end
48
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