#NEWLINE# def _setup_consumer( self ) : #NEWLINE# #INDENT# if ( self . consumer is not None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . consumer . cancel ( ) #NEWLINE# #UNINDENT# except socket . error : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# channel = self . connection . channel ( ) #NEWLINE# self . queue = self . queue . bind ( channel ) #NEWLINE# maybe_declare ( self . queue , channel ) #NEWLINE# consumer = Consumer ( channel , queues = [ consumer . queue ] , accept = self . accept , no_ack = False ) #NEWLINE# consumer . callbacks = [ self . on_message ] #NEWLINE# consumer . consume ( ) #NEWLINE# self . consumer = consumer