Module: Concurrent::OptionsParser
Overview
A mixin module for parsing options hashes related to gem-level configuration.
Instance Method Summary collapse
-
#get_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
-
#get_operation_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
-
#get_task_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
Instance Method Details
#get_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
14 15 16 17 18 19 20 21 22 |
# File 'lib/concurrent/options_parser.rb', line 14 def get_executor_from(opts = {}) if opts[:executor] opts[:executor] elsif opts[:operation] == true || opts[:task] == false Concurrent.configuration.global_operation_pool else Concurrent.configuration.global_task_pool end end |
#get_operation_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
40 41 42 |
# File 'lib/concurrent/options_parser.rb', line 40 def get_operation_executor_from(opts = {}) opts[:operation_executor] || opts[:executor] || Concurrent.configuration.global_operation_pool end |
#get_task_executor_from(opts = {}) ⇒ Executor
Get the requested ‘Executor` based on the values set in the options hash.
30 31 32 |
# File 'lib/concurrent/options_parser.rb', line 30 def get_task_executor_from(opts = {}) opts[:task_executor] || opts[:executor] || Concurrent.configuration.global_task_pool end |