Class: PublisherRenoteDac::Publisher
- Inherits:
-
Object
- Object
- PublisherRenoteDac::Publisher
- Defined in:
- app/services/publisher_renote_dac/publisher.rb
Class Method Summary collapse
Class Method Details
.channel ⇒ Object
9 10 11 |
# File 'app/services/publisher_renote_dac/publisher.rb', line 9 def self.channel @channel ||= connection.create_channel end |
.connection ⇒ Object
13 14 15 16 17 |
# File 'app/services/publisher_renote_dac/publisher.rb', line 13 def self.connection @connection ||= Bunny.new().tap do |c| c.start end end |
.publish(exchange, message = {}) ⇒ Object
4 5 6 7 |
# File 'app/services/publisher_renote_dac/publisher.rb', line 4 def self.publish(exchange, = {}) x = channel.fanout(exchange) x.publish(.to_json) end |