def get_executor_from(opts = {})
      if (executor = opts[:executor]).is_a? Symbol
        case opts[:executor]
        when :fast
          Garcon.global_fast_executor
        when :io
          Garcon.global_io_executor
        when :immediate
          Garcon::ImmediateExecutor.new
        else
          raise ArgumentError, "executor '#{executor}' not recognized"
        end
      elsif opts[:executor]
        opts[:executor]
      else
        nil
      end
    end
def get_executor_from(opts = {})
      if (executor = opts[:executor]).is_a? Symbol
        case opts[:executor]
        when :fast
          Garcon.global_fast_executor
        when :io
          Garcon.global_io_executor
        when :immediate
          Garcon::ImmediateExecutor.new
        else
          raise ArgumentError, "executor '#{executor}' not recognized"
        end
      elsif opts[:executor]
        opts[:executor]
      else
        nil
      end
    end
Get the requested `Executor` based on the values set in the options hash.

 @param [Hash] opts
   The options defining the requested executor.

 @option opts [Executor] :executor
   When set use the given `Executor` instance. Three special values are
   also supported: `:fast` returns the global fast executor, `:io` returns
   the global io executor, and `:immediate` returns a new
   `ImmediateExecutor` object.

 @return [Executor, nil]
   The requested thread pool, or nil when no option specified.

 @!visibility private