http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#application
里面的代码:
from celery import Celery
app = Celery('tasks', broker='redis://127.0.0.1:6379/0')
@app.task
def add(x, y):
return x + y
app可以叫任何名字, 比如celery, xyz 等等, 启动方式都一样
celery -A tasks worker --loglevel=info
网友评论