class LaGear::Bus::DelayablePublisher

Public Class Methods

publish(routing_key, msg, opts = {}) click to toggle source
# File lib/la_gear/bus.rb, line 77
def self.publish(routing_key, msg, opts = {})
  opts = opts.merge(to_queue: routing_key)
  if $publisher
    $publisher.with do |publisher|
      publisher.publish(msg, opts)
    end
  else # this is what integration tests might use
    LaGear::Publisher.new.publish(msg, opts)
  end
end