def run(self): # Parameters to be passed on to the queue worker queue_name = 'SEMANTICS_QUEUE' options = { 'exchange_name': 'metadata', 'exchange_type': 'fanout', 'durable_queue': True, 'prefetch_count': self.num_workers } drop_consumer = Consumer("semanticsqueue-consumer", self.mq_host, 'SEMANTICS_QUEUE', options) drop_publisher = Publisher("Response Publisher", mq_host) for x in range(self.num_workers): SemanticsQueueWorker("semanticsqueue-worker-" + str(x), drop_consumer.message_queue, drop_consumer.confirm_queue, self.api_url, drop_publisher, self.lock, self.max_retries, self.sleep_time, self.retry_cache) log.info("Workers started") drop_consumer.join() log.info("Exiting")
def run(self): options = { 'exchange_name': 'metadata', 'exchange_type': 'fanout', 'durable_queue': True, 'prefetch_count': self.num_workers } drop_consumer = Consumer("mediaextractor-consumer", self.mq_host, 'MEDIA_EXTRACTOR_QUEUE', options) drop_publisher = Publisher("Response Publisher", mq_host) for x in range(self.num_workers): MediaExtractorQueueWorker("mediaextractor-worker-" + str(x), drop_consumer.message_queue, drop_consumer.confirm_queue, drop_publisher, self.cf_options, self.url_services) log.info("Workers started") drop_consumer.join() log.info("Exiting")