Class: Aws::SQS::QueuePoller::PollerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-sqs/queue_poller.rb

Overview

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

Constant Summary collapse

CONFIG_OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Set.new([
  :idle_timeout,
  :skip_delete,
  :before_request,
])
PARAM_OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Set.new([
  :wait_time_seconds,
  :max_number_of_messages,
  :visibility_timeout,
  :attribute_names,
  :message_attribute_names,
])

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PollerConfig

Returns a new instance of PollerConfig.



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/aws-sdk-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

Instance Attribute Details

#before_requestProc? (readonly)

Returns:

  • (Proc, nil)


474
475
476
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 474

def before_request
  @before_request
end

#idle_timeoutInteger? (readonly)

Returns:

  • (Integer, nil)


468
469
470
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 468

def idle_timeout
  @idle_timeout
end

#request_paramsHash (readonly)

Returns:

  • (Hash)


477
478
479
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 477

def request_params
  @request_params
end

#skip_deleteBoolean (readonly)

Returns:

  • (Boolean)


471
472
473
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 471

def skip_delete
  @skip_delete
end

Instance Method Details

#with(options) ⇒ PollerConfig

Returns a new Aws::SQS::QueuePoller::PollerConfig instance with the given options applied.

Returns:



505
506
507
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 505

def with(options)
  self.class.new(to_h.merge(options))
end