Class: Aws::SQS::Message::Collection

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

Batch Actions collapse

Instance Method Details

#batch_delete!(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/aws-sdk-sqs/message.rb', line 238

def batch_delete!(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:queue_url] = batch[0].queue_url
    params[:entries] ||= []
    batch.each do |item|
      params[:entries] << {
        id: item.message_id,
        receipt_handle: item.receipt_handle
      }
    end
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.delete_message_batch(params)
    end
  end
  nil
end