def done(delay=nil)
        super(delay) do
          yield if block_given?
          EM.next_tick do
            run_em_hooks :amqp_after
            if AMQP.conn and not AMQP.closing
              AMQP.stop_connection do
                AMQP.cleanup_state
                finish_em_loop
              end
            else
              AMQP.cleanup_state
              finish_em_loop
            end
          end
        end
      end
def done(delay=nil)
        super(delay) do
          yield if block_given?
          EM.next_tick do
            run_em_hooks :amqp_after
            if AMQP.conn and not AMQP.closing
              AMQP.stop_connection do
                AMQP.cleanup_state
                finish_em_loop
              end
            else
              AMQP.cleanup_state
              finish_em_loop
            end
          end
        end
      end
Breaks the event loop and finishes the spec. It yields to any given block first,
 then stops AMQP, EM event loop and cleans up AMQP state.