module Concurrent::OptionsParser
def get_executor_from(opts = {})
-
(Executor)- the requested thread pool (default: global task pool)
Options Hash:
(**opts)-
:task(Boolean) -- when true use the global task pool -
:operation(Boolean) -- when true use the global operation pool -
:executor(Executor) -- when set use the given `Executor` instance
Parameters:
-
opts(Hash) -- the options defining the requested executor
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
def get_operation_executor_from(opts = {})
-
(Executor)- the requested thread pool (default: global operation pool)
Options Hash:
(**opts)-
:task_executor(Executor) -- when set use the given `Executor` instance
Parameters:
-
opts(Hash) -- the options defining the requested executor
def get_operation_executor_from(opts = {}) opts[:operation_executor] || opts[:executor] || Concurrent.configuration.global_operation_pool end
def get_task_executor_from(opts = {})
-
(Executor)- the requested thread pool (default: global task pool)
Options Hash:
(**opts)-
:task_executor(Executor) -- when set use the given `Executor` instance
Parameters:
-
opts(Hash) -- the options defining the requested executor
def get_task_executor_from(opts = {}) opts[:task_executor] || opts[:executor] || Concurrent.configuration.global_task_pool end