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 %i[ idle_timeout skip_delete before_request after_empty_receive ]
- 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 %i[ wait_time_seconds max_number_of_messages visibility_timeout attribute_names message_attribute_names ]
Instance Attribute Summary collapse
- #after_empty_receive ⇒ Proc? readonly
- #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.
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 511 def initialize() @idle_timeout = nil @skip_delete = false @before_request = nil @after_empty_receive = 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
#after_empty_receive ⇒ Proc? (readonly)
506 507 508 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 506 def after_empty_receive @after_empty_receive end |
#before_request ⇒ Proc? (readonly)
503 504 505 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 503 def before_request @before_request end |
#idle_timeout ⇒ Integer? (readonly)
497 498 499 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 497 def idle_timeout @idle_timeout end |
#request_params ⇒ Hash (readonly)
509 510 511 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 509 def request_params @request_params end |
#skip_delete ⇒ Boolean (readonly)
500 501 502 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 500 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.
544 545 546 |
# File 'lib/aws-sdk-sqs/queue_poller.rb', line 544 def with() self.class.new(to_h.merge()) end |