class Aws::SQS::QueuePoller::PollerConfig

A read-only set of configuration used by the QueuePoller.

Constants

CONFIG_OPTIONS

@api private

PARAM_OPTIONS

@api private

Attributes

before_request[R]

@return [Proc,nil]

idle_timeout[R]

@return [Integer,nil]

request_params[R]

@return [Hash]

skip_delete[R]

@return [Boolean]

Public Class Methods

new(options) click to toggle source
# File lib/aws-sdk-resources/services/sqs/queue_poller.rb, line 479
def initialize(options)
  @idle_timeout = nil
  @skip_delete = false
  @before_request = nil
  @request_params = {
    wait_time_seconds: 20,
    max_number_of_messages: 1,
    visibility_timeout: nil,
    attribute_names: ['All'],
    message_attribute_names: ['All'],
  }
  options.each do |opt_name, value|
    if CONFIG_OPTIONS.include?(opt_name)
      instance_variable_set("@#{opt_name}", value)
    elsif PARAM_OPTIONS.include?(opt_name)
      @request_params[opt_name] = value
    else
      raise ArgumentError, "invalid option #{opt_name.inspect}"
    end
  end
  @request_params.freeze
  freeze
end

Public Instance Methods

with(options) click to toggle source

@return [PollerConfig] Returns a new {PollerConfig} instance

with the given options applied.
# File lib/aws-sdk-resources/services/sqs/queue_poller.rb, line 505
def with(options)
  self.class.new(to_h.merge(options))
end

Private Instance Methods

to_h() click to toggle source
# File lib/aws-sdk-resources/services/sqs/queue_poller.rb, line 511
def to_h
  hash = {}
  CONFIG_OPTIONS.each { |key| hash[key] = send(key) }
  PARAM_OPTIONS.each { |key| hash[key] = @request_params[key] }
  hash
end