pyramid_celery
pyramid_celery copied to clipboard
Example is confusing
In reading the example, the term "task" is very overloaded. It refers to a model object, a property of that object, as well as celery's task concept. For example:
@task
def add_task(task):
time.sleep(random.choice([2,4,6,8,10]))
print 'creating task %s' % task
task = TaskItem(task=task)
DBSession.add(task)
transaction.commit()
I would suggest adopting some other arbitrary model for the purposes of the example. It would make it easier for a newb such as myself to understand. :)
I should add that the Executing worker section was rather confusing for me to.
celery worker -A pyramid_celery.celery_app --ini myappsettings.ini
, where celery_app
is my actual app name didn't work..
celery worker -A pyramid_celery --ini myappsetting.ini
worked.
Is that the expected behavior ?