class 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 389 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 394 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 399 def unsubscribe ActiveMessaging.logger.error "=> Unsubscribing from #{destination.value} (processed by #{processor_class})" Gateway.connection(destination.broker_name).unsubscribe(destination.value, subscribe_headers) end