class ResourceSubscriber::Publisher

Public Instance Methods

publish_as(routing_key) { |config| ... } click to toggle source
# File lib/resource_subscriber/publisher.rb, line 12
def publish_as(routing_key)
  yield(self.config) if block_given?
  self.config.routing_key = routing_key
end
publish_resource_message(action, resource) click to toggle source
# File lib/resource_subscriber/publisher.rb, line 7
def publish_resource_message(action, resource)
  message = ::ResourceSubscriber::Message.new(resource)
  ::ActionSubscriber::Publisher.publish_async("#{self.config.routing_key}.#{action}", message.to_json, self.config.exchange, self.config.publishing_options)
end