celery使用

##celery_study.py
from celery import Celery app=Celery('tasks',broker='amqp://guest@192.168.1.79//') @app.task def add(x,y): return x+y

linux shell启动:celery -A celery_study worker --loglevel=info

linux shell#cd 到celery_study.py的目录 执行python

>>from  celery_study import add

>>add.delay(3,4)

原文地址:https://www.cnblogs.com/howhy/p/7742763.html