Class: RubyRabbitmqJanus::Rabbit::Publisher::PublishKeepalive

Inherits:
RubyRabbitmqJanus::Rabbit::Publisher show all
Defined in:
lib/rrj/rabbit/publish/keepalive.rb

Overview

# Publish message for keepalive thread

The name to queue it’s created automatically by Bunny GEM

See Also:

  • KeepaliveThread

Author:

Instance Method Summary collapse

Constructor Details

#initialize(exchange) ⇒ PublishKeepalive

Returns a new instance of PublishKeepalive.



14
15
16
17
18
# File 'lib/rrj/rabbit/publish/keepalive.rb', line 14

def initialize(exchange)
  @reply = exchange.queue('', exclusive: true)
  super(exchange)
  subscribe_to_queue
end

Instance Method Details

#publish(request) ⇒ Object



20
21
22
23
24
25
# File 'lib/rrj/rabbit/publish/keepalive.rb', line 20

def publish(request)
  super(request)
  return_response
rescue
  raise Errors::Rabbit::PublishExclusive::Publish
end