def _run_producer_wrapper(self):
        '''Run the producer, if exception, stop engine.'''
        try:
            yield from self._producer.process()
        except Exception as error:
            if not isinstance(error, StopIteration):
                # Stop the workers so the producer exception will be handled
                # when we finally yield from this coroutine
                _logger.debug('Producer died.', exc_info=True)
                self.stop()
            raise
        else:
            self.stop()
def _run_producer_wrapper ( self ) : try : yield from self . _producer . process ( ) except Exception as error : if not isinstance ( error , StopIteration ) : _logger . debug ( 'Producer died.' , exc_info = True ) self . stop ( ) raise else : self . stop ( )
Run the producer, if exception, stop engine.