Class: Acheron::Exec
- Inherits:
-
Struct
- Object
- Struct
- Acheron::Exec
- Defined in:
- lib/acheron/exec.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config
10 11 12 |
# File 'lib/acheron/exec.rb', line 10 def config @config end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/acheron/exec.rb', line 12 def run check reconnect x_name = config.rabbitmq.exchange exchange = @channel.fanout(x_name) queue = @channel.queue('', exclusive: true) queue.bind(exchange) queue.subscribe(block: true) do |info, prop, body| slack JSON.parse(body)['msg'] end rescue Bunny::ConnectionClosedError => e # if the connection is closed make it reconnect and try again reconnect retry end |