#NEWLINE# def __init__( self , name , processor , connection , queue = None , qos = None , no_ack = False , exclusive = False , ack_after_failed_processing = False , ack_after_successful_processing = True , nack_after_failed_processing = True , channel_reopen_interval = 1 , log_processor_exceptions = 'warn' ) : #NEWLINE# #INDENT# '\n        :param name: Logical name of this consumer.\n        :param processor: The processor used to process the messages.\n        :param connection: Name of the connection.\n        :param queue: Either a name (string) or a queue declaration (dict).\n            See `queue_declare <http://www.rabbitmq.com/amqp-0-9-1-quickref.html#queue.declare>`_.\n        :param qos: Used to specify the QOS on the channel.\n\n        :param no_ack: Informs the broker that we do not intend to ack consumed messages.\n            If no_ack is true, ack_after/nack_after settings are ignored.\n        :param ack_after_successful_processing: If true, acks messages if processing finishes\n            without errbacking.\n        :param nack_after_failed_processing: If true, rejects messages if processing errbacks.\n        :param ack_after_failed_processing: If true, acks messages even if processing errbacks.\n\n        :param exclusive: Request exclusive consumer access, meaning only this consumer can access the queue.\n\n        :param channel_reopen_interval: Time (in seconds) to wait before reopening the consuming\n            channel if it closes.\n        :param log_processor_exceptions: Log level for exceptions raised by our processor. Set to None\n            to disable.\n        ' #NEWLINE# self . name = name #NEWLINE# self . processor_config = ( dict ( provider = processor ) if isinstance ( processor , basestring ) else processor ) #NEWLINE# self . connection_name = connection #NEWLINE# if isinstance ( queue , basestring ) : #NEWLINE# #INDENT# queue = dict ( queue = queue , passive = True ) #NEWLINE# #UNINDENT# self . queue_declare = ( queue or dict ( queue = '' ) ) #NEWLINE# self . qos = ( qos or dict ( ) ) #NEWLINE# self . no_ack = no_ack #NEWLINE# self . ack_after_successful_processing = ack_after_successful_processing #NEWLINE# self . nack_after_failed_processing = nack_after_failed_processing #NEWLINE# self . ack_after_failed_processing = ack_after_failed_processing #NEWLINE# if ( self . ack_after_failed_processing and self . nack_after_failed_processing ) : #NEWLINE# #INDENT# e_msg = 'Cannot both ack and nack after failed processing.' #NEWLINE# raise exceptions . ConfigurationError ( e_msg ) #NEWLINE# #UNINDENT# self . exclusive = exclusive #NEWLINE# self . channel_reopen_interval = channel_reopen_interval #NEWLINE# self . log_processor_exceptions = log_processor_exceptions #NEWLINE# if log_processor_exceptions : #NEWLINE# #INDENT# available_log_levels = [ key . lower ( ) for key in logging . _levelNames . keys ( ) if isinstance ( key , basestring ) ] #NEWLINE# if ( log_processor_exceptions not in available_log_levels ) : #NEWLINE# #INDENT# e_msg = 'Invalid log level {0!r}.' . format ( log_processor_exceptions . lower ( ) ) #NEWLINE# hint = 'Available log levels: {0}' . format ( available_log_levels ) #NEWLINE# raise exceptions . ConfigurationError ( e_msg , hint )