#NEWLINE# def on_iteration( self ) : #NEWLINE# #INDENT# ' Kombu callback for each `drain_events` loop iteration.' #NEWLINE# self . _cancel_consumers_if_requested ( ) #NEWLINE# self . _process_pending_message_acks ( ) #NEWLINE# num_consumers = len ( self . _consumers ) #NEWLINE# num_pending_messages = len ( self . _pending_messages ) #NEWLINE# if ( ( num_consumers + num_pending_messages ) == 0 ) : #NEWLINE# #INDENT# _log . debug ( 'requesting stop after iteration' ) #NEWLINE# self . should_stop = True