#NEWLINE# def on_closed( self , connection , reply_code , reply_text , callback = None ) : #NEWLINE# #INDENT# 'This method is invoked by pika when the connection to RabbitMQ is\n        closed unexpectedly. Since it is unexpected, we will reconnect to\n        RabbitMQ if it disconnects.\n\n        :param pika.connection.Connection connection: The closed connection obj\n        :param int reply_code: The server provided reply_code if given\n        :param str reply_text: The server provided reply_text if given\n\n        ' #NEWLINE# self . _channel = None #NEWLINE# logging . warning ( 'Connection closed, reopening in 5 seconds: (%s) %s' , reply_code , reply_text ) #NEWLINE# connection . add_timeout ( 5 , partial ( connection . connect , callback = callback ) )