Method: EventQ::Amazon::SQS#create_queue

Defined in:
lib/eventq/eventq_aws/sqs.rb

#create_queue(queue, attributes = {}) ⇒ Object

Create a new queue.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/eventq/eventq_aws/sqs.rb', line 17

def create_queue(queue, attributes = {})
  _queue_name = EventQ.create_queue_name(queue)

  url = get_queue_url(queue)
  unless url
    response = sqs.create_queue(
      {
        queue_name: aws_safe_name(_queue_name),
        attributes: attributes
      }
    )
    url = response.queue_url
    @@queue_urls[_queue_name] = url
  end

  url
end