Method: Aws::Sqs::Queue#clear
- Defined in:
- lib/sqs/sqs.rb
#clear ⇒ Object
Clears queue, deleting only the visible messages. Any message within its visibility timeout will not be deleted, and will re-appear in the queue in the future when the timeout expires.
To delete all messages in a queue and eliminate the chance of any messages re-appearing in the future, it’s best to delete the queue and re-create it as a new queue. Note that doing this will take at least 60 s since SQS does not allow re-creation of a queue within this interval.
queue.clear() #=> true
148 149 150 |
# File 'lib/sqs/sqs.rb', line 148 def clear() @sqs.interface.clear_queue(@url) end |