Parent

Files

Class/Module Index [+]

Quicksearch

ActiveMessaging::Subscription

Attributes

destination[RW]
processor_class[RW]
subscribe_headers[RW]

Public Class Methods

new(destination, processor_class, subscribe_headers = {}) click to toggle source
# File lib/activemessaging/gateway.rb, line 385
def initialize(destination, processor_class, subscribe_headers = {})
  @destination, @processor_class, @subscribe_headers = destination, processor_class, subscribe_headers
  subscribe_headers['id'] = processor_class.name.underscore unless subscribe_headers.key? 'id'
end

Public Instance Methods

subscribe() click to toggle source
# File lib/activemessaging/gateway.rb, line 390
def subscribe
  ActiveMessaging.logger.error "=> Subscribing to #{destination.value} (processed by #{processor_class})"
  Gateway.connection(@destination.broker_name).subscribe(@destination.value, subscribe_headers) 
end
unsubscribe() click to toggle source
# File lib/activemessaging/gateway.rb, line 395
def unsubscribe
  ActiveMessaging.logger.error "=> Unsubscribing from #{destination.value} (processed by #{processor_class})"
  Gateway.connection(destination.broker_name).unsubscribe(destination.value, subscribe_headers)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.