Getting Started
Include pyramid_celery either by setting your includes in your .ini,
or by calling config.include('pyramid_celery').
- ``` python
System Message: WARNING/2 (<string>, line 6); backlink
Inline literal start-string without end-string.
pyramid.includes = pyramid_celery
System Message: WARNING/2 (<string>, line 8)
Definition list ends without a blank line; unexpected unindent.
```
System Message: WARNING/2 (<string>, line 8); backlink
Inline literal start-string without end-string.
System Message: WARNING/2 (<string>, line 8); backlink
Inline interpreted text or phrase reference start-string without end-string.
Now you can either use class based:
``` python
from celery.task import task
from celery.task import Task
System Message: WARNING/2 (<string>, line 12); backlink
Inline literal start-string without end-string.
@task
class AddTask(Task):
System Message: ERROR/3 (<string>, line 18)
Unexpected indentation.
- def run(self, x, y):
- print x+y
System Message: WARNING/2 (<string>, line 20)
Block quote ends without a blank line; unexpected unindent.
```
System Message: WARNING/2 (<string>, line 20); backlink
Inline literal start-string without end-string.
System Message: WARNING/2 (<string>, line 20); backlink
Inline interpreted text or phrase reference start-string without end-string.
or decorator based:
``` python
from celery.task import task
System Message: WARNING/2 (<string>, line 24); backlink
Inline literal start-string without end-string.
@task
def add(x, y):
System Message: ERROR/3 (<string>, line 29)
Unexpected indentation.
print x+y
System Message: WARNING/2 (<string>, line 30)
Block quote ends without a blank line; unexpected unindent.
```
System Message: WARNING/2 (<string>, line 30); backlink
Inline literal start-string without end-string.
System Message: WARNING/2 (<string>, line 30); backlink
Inline interpreted text or phrase reference start-string without end-string.
Demo
To see it all in action check out pyramid_celery_demo, run rabbitmq-server and then do:
` python
$ python setup.py develop
$ populate_pyramid_celery_demo ./development.ini
$ pserve ./development.ini
$ pceleryd ./development.ini
`