redis-windows 安装 以及 celery 的配置

windows版:https://github.com/MSOpenTech/redis/releases 下载 (压缩包或者安装包)

启动命令 redis-server.exe redis.windows.conf

当启动服务后, 另起一个dos窗口 redis-cli.exe 进入redis界面

redis常用命令参考 http://redisdoc.com/

 

celery 

tests.py

app = Celery("tasks", broker="redis://localhost:6379/XX")   XX 为 redis数据库编号

app.conf.update(setting) # setting 为字典 redis的配置

@app.task

def test():

  .....

celery -A  tests worker --pool=solo -l info # 消耗任务启动 ,更多启动参数  celery worker --help

test.delay() # 生产任务

 

posted on 2018-03-02 15:38  0o0o0o0o0o000  阅读(136)  评论(0编辑  收藏  举报

导航