celery学习笔记

2017-03-31  本文已影响14人  暂时还没有昵称2222

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
上一篇下一篇

猜你喜欢

热点阅读