'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'):

    if self.is_closed:
        LOGGER.debug('Close    called    on    closed    connection    (%s):    %s', reply_code, reply_text)
        return
    LOGGER.info('Closing    connection    (%s):    %s', reply_code, reply_text)
    self._user_initiated_close = True
    for impl_channel in pika.compat.dictvalues(self._impl._channels):
        channel = impl_channel._get_cookie()
        if channel.is_open:
            try:
                channel.close(reply_code, reply_text)
            except exceptions.ChannelClosed as exc:
                LOGGER.warning('Got    ChannelClosed    while    closing    channel    from    connection.close:    %r', exc)
    self._impl.close(reply_code, reply_text)
    self._flush_output(self._closed_result.is_ready)
