@tony-yin
        
        2018-04-03T01:23:46.000000Z
        字数 572
        阅读 1423
    Celery
yum install erlang
yum install rabbitmq-server -y 
systemctl start rabbitmq-server 
systemctl enable rabbitmq-server
yum repolist 
yum install redis php-pecl-redis 
systemctl start redis 
systemctl enable redis 
pip install redis
from tasks import addadd.delay(5, 5)with open('output.log', 'a') as f:f.write('===== current ====' + "\n")
from celery import Celeryapp = Celery('tasks', broker='redis://guest@localhost//')@app.taskdef add(x, y):with open('output.log', 'a') as f:f.write('===== delay ====' + "\n")return x + y
server:
celery -A tasks worker --loglevel=info
client:
python client.py
