Module: Ruote::Amqp

Defined in:
lib/ruote/amqp/alert_participant.rb,
lib/ruote/amqp/participant.rb,
lib/ruote/amqp/receiver.rb,
lib/ruote/amqp/version.rb,
lib/ruote/amqp.rb

Defined Under Namespace

Classes: AlertParticipant, Participant, Receiver, RemoteError

Constant Summary collapse

VERSION =
'2.3.0.1'

Class Method Summary collapse

Class Method Details

.sessionObject

Returns the AMQP::Session shared by the ruote participants (and potentially the receivers too).

Returns nil if none is set (the participant will mostly create a connection on their own).

See rubydoc.info/github/ruby-amqp/amqp/master/AMQP/Session



41
42
43
44
# File 'lib/ruote/amqp.rb', line 41

def self.session

  @session
end

.session=(s) ⇒ Object

Sets the AMQP::Session shared by the ruote participants (and potentially the receivers too).

Ruote::Amqp.session = AMQP.connect(:auto_recovery => true) do |con|
  con.on_recovery do |con|
    puts "Recovered..."
  end
  connection.on_tcp_connection_loss do |con, settings|
    puts "Reconnecting... please wait"
    conn.reconnect(false, 20)
  end
end

(Thanks Jim Li - github.com/marsbomber/ruote-amqp/commit/0f36a41f)

See rubydoc.info/github/ruby-amqp/amqp/master/AMQP/Session



63
64
65
66
# File 'lib/ruote/amqp.rb', line 63

def self.session=(s)

  @session = s
end