Class: Aws::SQS::QueuePoller::PollerConfig
- Inherits:
-
Object
- Object
- Aws::SQS::QueuePoller::PollerConfig
- 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
- #before_request ⇒ Proc? readonly
- #idle_timeout ⇒ Integer? readonly
- #request_params ⇒ Hash readonly
- #skip_delete ⇒ Boolean readonly
Instance Method Summary collapse
-
#initialize(options) ⇒ PollerConfig
constructor
A new instance of PollerConfig.
-
#with(options) ⇒ PollerConfig
Returns a new PollerConfig instance with the given options applied.
Constructor Details
#initialize(options) ⇒ PollerConfig
Returns a new instance of PollerConfig.
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 481 def initialize() @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'], } .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[:max_number_of_messages] unless .is_a?(Integer) && .positive? raise ArgumentError, ':max_number_of_messages must be a positive integer' end @request_params.freeze freeze end |
Instance Attribute Details
#before_request ⇒ Proc? (readonly)
476 477 478 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 476 def before_request @before_request end |
#idle_timeout ⇒ Integer? (readonly)
470 471 472 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 470 def idle_timeout @idle_timeout end |
#request_params ⇒ Hash (readonly)
479 480 481 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 479 def request_params @request_params end |
#skip_delete ⇒ Boolean (readonly)
473 474 475 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 473 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.
513 514 515 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 513 def with() self.class.new(to_h.merge()) end |