Class: LaGear::Bus::DelayablePublisher

Inherits:
Object
  • Object
show all
Defined in:
lib/la_gear/bus.rb

Class Method Summary collapse

Class Method Details

.publish(routing_key, msg, opts = {}) ⇒ Object



75
76
77
78
79
80
81
82
83
84
# File 'lib/la_gear/bus.rb', line 75

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