Size: 416
Comment:
|
Size: 1175
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html |
|
Line 18: | Line 20: |
== Test app with Redis == Run redis: {{{#!highlight bash $redis-server & $redis-cli redis 127.0.0.1:6379> quit }}} App: {{{#!highlight python from celery import Celery app = Celery('tasks', broker='redis://localhost') @app.task def add(x, y): return x + y }}} {{{#!highlight bash $celery -A celeryTest worker --loglevel=info }}} Run task {{{#!highlight bash $ python Python 2.7.3 (default, Jul 3 2012, 19:58:39) [GCC 4.7.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from celeryTest import add >>> add.delay(3,3) <AsyncResult: 7890ae15-000b-4d93-9378-3fbb3fb00f26> >>> }}} |
Celery
Celery is an asynchronous task queue/job queue based on distributed message passing.
http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html
Slackware 14 installation
- easy_install celery
Check installation:
Test app with Redis
Run redis:
App:
1 $celery -A celeryTest worker --loglevel=info
Run task