Class: SimpleRabbit::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_rabbit/publisher.rb

Class Method Summary collapse

Class Method Details

.publish(queue_name, message) ⇒ Object



5
6
7
8
9
# File 'lib/simple_rabbit/publisher.rb', line 5

def self.publish(queue_name, message)
  raise ConnectionNotEstablished unless $simplerabbit_connection
  queue = $simplerabbit_channel.queue(queue_name, durable: true)
  queue.publish(message, persistent: true)
end