- Decorator based task
- auto route and import
- ONLY support mongodb
Include pyramid_celery either by setting your includes in your .ini, or by calling config.include('pyramid_celery').
pyramid.includes = pyramid_celery
mongodb.uri = mongodb://localhost:1234
celery.dbname = celery
This will register all the functions decerotated with @task.
Then do scan to activate celery broker in myapp/init.py:
config.scan()
Now you can either use class based:
from pyramid_celery import task
@task(name='add')
def add(self, x, y):
print x+y
to define route of a task, do
from pyramid_celery import Task
class RemoteTask(Task):
queue = 'remote'
@RemoteTask()
def mult(self, x, y):
return x*y
All standard celery configuration options will work. Check out http://ask.github.com/celery/configuration.html
Not supported currently