Class: ActiveMessaging::Adapters::Sqs::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/activemessaging/adapters/sqs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination, headers = {}, count = 1) ⇒ Subscription

Returns a new instance of Subscription.



423
424
425
426
# File 'lib/activemessaging/adapters/sqs.rb', line 423

def initialize(destination, headers={}, count=1)
  @priority = headers.delete(:priority) || 1001
  @destination, @headers, @count = destination, headers, count
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



421
422
423
# File 'lib/activemessaging/adapters/sqs.rb', line 421

def count
  @count
end

#destinationObject

Returns the value of attribute destination.



421
422
423
# File 'lib/activemessaging/adapters/sqs.rb', line 421

def destination
  @destination
end

#headersObject

Returns the value of attribute headers.



421
422
423
# File 'lib/activemessaging/adapters/sqs.rb', line 421

def headers
  @headers
end

#priorityObject

Returns the value of attribute priority.



421
422
423
# File 'lib/activemessaging/adapters/sqs.rb', line 421

def priority
  @priority
end

Instance Method Details

#addObject



428
429
430
# File 'lib/activemessaging/adapters/sqs.rb', line 428

def add
  @count += 1
end

#removeObject



432
433
434
# File 'lib/activemessaging/adapters/sqs.rb', line 432

def remove
  @count -= 1
end