Class: Osbourne::Queue
- Inherits:
-
Object
- Object
- Osbourne::Queue
- Includes:
- Services::SQS
- Defined in:
- lib/osbourne/queue.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prefixed_name ⇒ Object
readonly
Returns the value of attribute prefixed_name.
Instance Method Summary collapse
- #arn ⇒ Object
-
#initialize(name) ⇒ Queue
constructor
A new instance of Queue.
- #redrive(retries, dead_letter_arn) ⇒ Object
- #url ⇒ Object
Methods included from Services::SQS
Constructor Details
#initialize(name) ⇒ Queue
Returns a new instance of Queue.
7 8 9 10 11 |
# File 'lib/osbourne/queue.rb', line 7 def initialize(name) @name = name @prefixed_name = Osbourne.prefixer(@name) arn end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/osbourne/queue.rb', line 6 def name @name end |
#prefixed_name ⇒ Object (readonly)
Returns the value of attribute prefixed_name.
6 7 8 |
# File 'lib/osbourne/queue.rb', line 6 def prefixed_name @prefixed_name end |
Instance Method Details
#arn ⇒ Object
17 18 19 |
# File 'lib/osbourne/queue.rb', line 17 def arn @arn ||= get_attributes["QueueArn"] end |
#redrive(retries, dead_letter_arn) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/osbourne/queue.rb', line 21 def redrive(retries, dead_letter_arn) sqs.set_queue_attributes(queue_url: url, attributes: { 'RedrivePolicy': { 'deadLetterTargetArn': dead_letter_arn, 'maxReceiveCount': retries }.to_json }) end |
#url ⇒ Object
13 14 15 |
# File 'lib/osbourne/queue.rb', line 13 def url @url ||= ensure_queue end |