'Disconnect from RabbitMQ. If there are any open channels, it will
attempt to close them prior to fully disconnecting. Channels which
have active consumers will attempt to send a Basic.Cancel to RabbitMQ
to cleanly stop the delivery of messages prior to closing the channel.
:param int reply_code: The code number for the close
:param str reply_text: The text reason for the close'

def close(self, reply_code=200, reply_text='Normal    shutdown'):

    try:
        super(BaseConnection, self).close(reply_code, reply_text)
    finally:
        if self.is_closed:
            self._handle_ioloop_stop()
