Sha256: b7d0da9c338f31aa8add037809970d618abf8970736ab4513fd217e49dbf3dc5

Contents?: true

Size: 454 Bytes

Versions: 22

Compression:

Stored size: 454 Bytes

Contents

module Propono
  class QueueCreatorError < ProponoError
  end

  class QueueCreator
    include Sqs

    def self.find_or_create(name)
      new(name).find_or_create
    end

    def initialize(name)
      @name = name
    end

    def find_or_create
      result = sqs.create_queue(@name)
      body = result.body
      url = body.fetch('QueueUrl') { raise QueueCreatorError.new("No QueueUrl returned from SQS") }
      Queue.new(url)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
propono-1.4.0 lib/propono/services/queue_creator.rb
propono-1.3.0 lib/propono/services/queue_creator.rb
propono-1.2.0 lib/propono/services/queue_creator.rb
propono-1.1.3 lib/propono/services/queue_creator.rb
propono-1.1.2 lib/propono/services/queue_creator.rb
propono-1.1.1 lib/propono/services/queue_creator.rb
propono-1.1.0 lib/propono/services/queue_creator.rb
propono-1.0.0 lib/propono/services/queue_creator.rb
propono-1.0.0.rc3 lib/propono/services/queue_creator.rb
propono-1.0.0.rc2 lib/propono/services/queue_creator.rb
propono-1.0.0.rc1 lib/propono/services/queue_creator.rb
propono-0.11.1 lib/propono/services/queue_creator.rb
propono-0.11.0 lib/propono/services/queue_creator.rb
propono-0.10.0 lib/propono/services/queue_creator.rb
propono-0.9.1 lib/propono/services/queue_creator.rb
propono-0.9.0 lib/propono/services/queue_creator.rb
propono-0.8.2 lib/propono/services/queue_creator.rb
propono-0.8.0 lib/propono/services/queue_creator.rb
propono-0.7.0 lib/propono/services/queue_creator.rb
propono-0.6.3 lib/propono/services/queue_creator.rb