Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
 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')
Ejemplo n.º 4
0
 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')