Class: ActiveMessaging::Adapters::Sqs::Subscription
- Inherits:
-
Object
- Object
- ActiveMessaging::Adapters::Sqs::Subscription
- Defined in:
- lib/activemessaging/adapters/sqs.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#priority ⇒ Object
Returns the value of attribute priority.
Instance Method Summary collapse
- #add ⇒ Object
-
#initialize(destination, headers = {}, count = 1) ⇒ Subscription
constructor
A new instance of Subscription.
- #remove ⇒ Object
Constructor Details
#initialize(destination, headers = {}, count = 1) ⇒ Subscription
Returns a new instance of Subscription.
411 412 413 414 |
# File 'lib/activemessaging/adapters/sqs.rb', line 411 def initialize(destination, headers={}, count=1) @priority = headers.delete(:priority) || 1001 @destination, @headers, @count = destination, headers, count end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
409 410 411 |
# File 'lib/activemessaging/adapters/sqs.rb', line 409 def count @count end |
#destination ⇒ Object
Returns the value of attribute destination.
409 410 411 |
# File 'lib/activemessaging/adapters/sqs.rb', line 409 def destination @destination end |
#headers ⇒ Object
Returns the value of attribute headers.
409 410 411 |
# File 'lib/activemessaging/adapters/sqs.rb', line 409 def headers @headers end |
#priority ⇒ Object
Returns the value of attribute priority.
409 410 411 |
# File 'lib/activemessaging/adapters/sqs.rb', line 409 def priority @priority end |
Instance Method Details
#add ⇒ Object
416 417 418 |
# File 'lib/activemessaging/adapters/sqs.rb', line 416 def add @count += 1 end |
#remove ⇒ Object
420 421 422 |
# File 'lib/activemessaging/adapters/sqs.rb', line 420 def remove @count -= 1 end |