Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the huey consumer configuration?

I'm trying to get running the Huey task queue for python (it's a Celery alternative) and I'm stuck with starting the consumer with main.Configuration (as it's written in the tutorial). I know the huey_consumer is looking for the configfile somewhere in the python, but I cannot get it working according to the tutorial and I don't know why I should write a config file and load it as a module (instead of a file).

When I run huey_consumer.py main.Configuration it returns Unable to import "main".

Huey have this issue written in their common pitalls too, but it's not really helping either.

If there is somebody using Huey, please help me.

like image 648
Jakub Žitný Avatar asked Feb 19 '13 00:02

Jakub Žitný


People also ask

How do I run the Huey consumer?

To run the consumer, simply point it at the “import path” to your application’s Huey instance. For example, here is how I run it on my blog: The concept of the “import path” has been the source of a few questions, but it is quite simple.

How does Huey handle concurrency?

The consumer consists of a main process, a scheduler, and one or more workers. These individual components all run concurrently, and Huey supports three different mechanisms to achieve this concurrency. thread, the default - uses OS threads.

Do I need to start the scheduler if Huey is running?

Tasks enqueued for immediate execution will be run regardless of whether the scheduler is running. You only need to start the scheduler if you plan to schedule tasks in the future or run periodic tasks. Huey comes with special integration for use with the Django framework.

What is minihuey in Huey?

The huey.contrib package contains modules that provide extra functionality beyond the core APIs. MiniHuey provides a very lightweight huey-like API that may be useful for certain applications. The MiniHuey consumer runs inside a greenlet in your main application process.


1 Answers

I had the same problem and solved it by adding the directory containing main.py to the PYTHONPATH. There was no need to copy huey_consumer.py

like image 138
adg Avatar answered Oct 02 '22 00:10

adg