Module: AMQP
- Defined in:
- lib/amqp-spec/amqp.rb,
lib/version.rb,
lib/amqp-spec/rspec.rb,
lib/amqp-spec/evented_example.rb
Overview
require ‘fiber’ unless Fiber.respond_to?(:current)
Defined Under Namespace
Modules: EMSpec, Spec, SpecHelper
Class Method Summary collapse
-
.cleanup_state ⇒ Object
Cleans up AMQP state after AMQP connection closes.
-
.start_connection(opts = {}, &block) ⇒ Object
Initializes new AMQP client/connection without starting another EM loop.
-
.stop_connection ⇒ Object
Closes AMQP connection gracefully.
Class Method Details
.cleanup_state ⇒ Object
Cleans up AMQP state after AMQP connection closes
24 25 26 27 28 29 30 |
# File 'lib/amqp-spec/amqp.rb', line 24 def self.cleanup_state # MQ.reset ? Thread.list.each { |thread| thread[:mq] = nil } Thread.list.each { |thread| thread[:mq_id] = nil } @conn = nil @closing = false end |
.start_connection(opts = {}, &block) ⇒ Object
Initializes new AMQP client/connection without starting another EM loop
5 6 7 8 9 |
# File 'lib/amqp-spec/amqp.rb', line 5 def self.start_connection(opts={}, &block) # puts "!!!!!!!!! Existing connection: #{@conn}" if @conn @conn = connect opts @conn.callback(&block) if block end |