def handle(self, *args, **options): config = load_config('huey.djhuey.conf.Configuration') if options['threads'] is not None: config.THREADS = options['threads'] if options['periodic'] is not None: config.PERIODIC = options['periodic'] self.autodiscover() queue = config.QUEUE result_store = config.RESULT_STORE task_store = config.TASK_STORE invoker = Invoker(queue, result_store, task_store) consumer = Consumer(invoker, config) consumer.run()
def test_consumer_loader(self): config = load_config('huey.tests.config.Config') self.assertTrue(isinstance(config.QUEUE, DummyQueue)) self.assertEqual(config.QUEUE.name, 'test-queue')