gems/manageiq-providers-amazon/app/models/manageiq/providers/amazon/cloud_manager/event_catcher/stream.rb
#
# Collect events off the appliance-specific queue and return the events as a
# batch to the caller.
#
# :yield: array of Amazon events as hashes
#
Collect events off the appliance-specific queue and return the events as a
batch to the caller.

:yield: array of Amazon events as hashes
Collect events off the appliance - specific queue and return the events as a batch to the caller . : yield : array of Amazon events as hashes
def poll
    @ems.with_provider_connection(:service => :SQS) do |sqs|
      queue_poller = Aws::SQS::QueuePoller.new(
        find_or_create_queue,
        :client            => sqs.client,
        :wait_time_seconds => 20,
        :before_request    => @before_poll
      )
      begin
        queue_poller.poll do |sqs_message|
          $aws_log.debug("#{log_header} received message #{sqs_message}")
          throw :stop_polling if @stop_polling
          event = parse_event(sqs_message)
          yield event if event
        end
      rescue Aws::SQS::Errors::ServiceError => exception
        raise ProviderUnreachable, exception.message
      end
    end
  end
def poll @ems . with_provider_connection ( :service => :SQS ) do | sqs | queue_poller = Aws :: SQS :: QueuePoller . new ( find_or_create_queue , :client => sqs . client , :wait_time_seconds => 20 , :before_request => @before_poll ) begin queue_poller . poll do | sqs_message | $aws_log . debug ( "#{log_header} received message #{sqs_message}" ) throw :stop_polling if @stop_polling event = parse_event ( sqs_message ) yield event if event end rescue Aws :: SQS :: Errors :: ServiceError => exception raise ProviderUnreachable , exception . message end end end
Collect events off the appliance-specific queue and return the events as a
batch to the caller.
Collect events off the appliance - specific queue and return the events as a batch to the caller .