0
点赞
收藏
分享

微信扫一扫

celery使用

Mhhao 2022-06-27 阅读 77
##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)

 


举报

相关推荐

0 条评论