redis

http://debugo.com/python-redis

celery

https://gist.github.com/neara/11214948

https://gist.github.com/amatellanes/a986f6babb9cf8556e36

https://gist.github.com/IrSent/5e4820f6b187d3654967b55e27d5d204

http://funhacks.net/2016/12/13/celery/

https://www.ibm.com/developerworks/cn/opensource/os-cn-celery-web-service/index.html

http://docs.jinkan.org/docs/celery/getting-started/introduction.html

http://liuzxc.github.io/blog/celery/

https://realpython.com/blog/python/flask-by-example-implementing-a-redis-task-queue

http://liuzxc.github.io/blog/celery

http://blog.wifibao.im/index.php/archives/166

http://www.jianshu.com/p/1840035cb510

http://www.jianshu.com/p/9e422d9f1ce2

flask & celery:

https://blog.miguelgrinberg.com/post/using-celery-with-flask

http://liyangliang.me/posts/2015/11/using-celery-with-flask

http://shulhi.com/celery-integration-with-flask

http://aviaryan.in/blog/gsoc/celery-flask-using.html

http://doc.scalingo.com/languages/python/celery/getting-started-with-celery-and-flask

http://www.adikrishnan.in/2016/03/03/using-celery-with-flask/

flask & celery & redis:

http://celeodor.com/flask-flask-socketio-celery-and-redis-background-task-processing

https://moinulhossain.me/remote-celery-worker-for-flask-with-separate-code-base

http://louistiao.me/posts/deploy-flask-with-a-celery-task-queue-and-flower-dashboard-using-kubernetes

http://www.cnblogs.com/ajianbeyourself/p/4471391.html

ansible & celery

http://fengxsong.github.io/2016/05/27/ansible-celery

https://github.com/Erazx/ansible_api

https://github.com/onlytiancai/ansible-celery-flask-demo

https://github.com/yumaojun03/ansible_async_api

https://github.com/fengxsong/django-example

http://www.cnblogs.com/piperck/p/5391128.html

http://www.revsys.com/12days

yum -y install redis
chkconfig redis on && /etc/init.d/redis start

venv

pip install redis -i https://pypi.douban.com/simple
pip install celery -i https://pypi.douban.com/simple

broker(broker.py)

#!/usr/bin/env python
# -*- coding: utf-8 -*- from __future__ import absolute_import from celery import Celery, platforms
platforms.C_FORCE_ROOT = True app = Celery(__name__, broker='redis://127.0.0.1:6379/0', backend='redis://127.0.0.1:6379/0', include=['tasks'])

worker(tasks.py)

#!/usr/bin/env python
# -*- coding: utf-8 -*- from __future__ import absolute_import
from broker import app
import time @app.task
def longtime_add(x, y):
print 'long time task begins'
# sleep 5 seconds
time.sleep(5)
print 'long time task finished'
return x + y

client(run_tasks.py)

#!/usr/bin/env python
# -*- coding: utf-8 -*- from tasks import longtime_add
import time if __name__ == '__main__':
result = longtime_add.delay(1,2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
celery -A broker worker -l info
python run_tasks.py

python celery + redis的更多相关文章

  1. python之redis和memcache操作

    Redis 教程 Redis是一个开源(BSD许可),内存存储的数据结构服务器,可用作数据库,高速缓存和消息队列代理.Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据 ...

  2. django+celery+redis环境搭建

    初次尝试搭建django+celery+redis环境,记录下来,慢慢学习~ 1.安装apache 下载httpd-2.0.63.tar.gz,解压tar zxvf httpd-2.0.63.tar. ...

  3. Python Celery队列

    Celery队列简介: Celery 是一个 基于python开发的分布式异步消息任务队列,通过它可以轻松的实现任务的异步处理, 如果你的业务场景中需要用到异步任务,就可以考虑使用celery. 使用 ...

  4. django celery redis 定时任务

    0.目的 在开发项目中,经常有一些操作时间比较长(生产环境中超过了nginx的timeout时间),或者是间隔一段时间就要执行的任务. 在这种情况下,使用celery就是一个很好的选择.   cele ...

  5. celery + redis quick start

    软件: redis server redis-server.exe 安装redis for python using pip 安装celery (redis)  pip install -U &quo ...

  6. Celery+redis实现异步

    目录 Celery+redis实现异步 安装redis 安装celery-with-redis 添加celery相关配置 创建异步运行任务tasks.py 启动 Celery+redis实现异步 安装 ...

  7. python—Celery异步分布式

    python—Celery异步分布式 Celery  是一个python开发的异步分布式任务调度模块,是一个消息传输的中间件,可以理解为一个邮箱,每当应用程序调用celery的异步任务时,会向brok ...

  8. django+celery+redis实现运行定时任务

    0.目的 在开发项目中,经常有一些操作时间比较长(生产环境中超过了nginx的timeout时间),或者是间隔一段时间就要执行的任务. 在这种情况下,使用celery就是一个很好的选择.   cele ...

  9. Python操作Redis(一)

    redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set ...

随机推荐

  1. IIs安装&发布&解决遇到的问题

    IIS安装: IIS发布: 1.添加网站: 2.将发布的文件,copy到该网站的目录下 3. 刷新,文件显示出来,将其"转换为应用程序” => 4.在应用程序池中找到该网站相应的程序池 ...

  2. windows server 2012 FTP SMB 文件夹权限继承

    被坑了..win默认的权限继承,有继承就没有smb目录继承,有smb目录继承 父级文件夹的权限就删不掉.. 换ftp轻松愉快...

  3. [BZOJ 3123]森林

    这题和 COT1 一定有 JQ 喵~ 线段树的启发式合并,每次要连接两个点时就对比较小的那棵树暴力 DFS 一边 然后均摊时间依旧是 logn 的,均摊真是世界上最邪恶的东西了…… 然后这题的数据是要 ...

  4. 改进:js修改iOS微信浏览器的title

    问题简介 前端入门没多久,可能连入门也不算,最近网上流行各自书籍改名,什么<前端开发,从入门到放弃>,<Android开发,从入门到改行>之类的,程序员真是个爱自嘲的群体,但我 ...

  5. [2016.01.22]万峰文本处理专家 v2.1

    <万峰文本处理专家>是一款简单易用,且功能强大的各类文本文件处理软件.1.支持多任务的处理模式,允许一次处理多个任务.2.支持正则表达式替换,替换更加强大:3.支持各类关键字的行处理操作: ...

  6. HoloLens模拟器仿真器与文档现已向开发者们开放

    HoloLens仿真器与文档现已向开发者们开放 直接上链接吧:http://mt.sohu.com/20160301/n438961462.shtml

  7. <<Exceptional C++>> notes

    - class Complex { public: ) : real_(real), imaginary_(imaginary) { } Complex& operaor+=(const Co ...

  8. 在macos上利用vmware fusion安装Ubuntu

    1. 安装vmware fusion http://www.vmware.com/products/fusion 下载以后,可以在网上找注册码,最好下载最新的,这里下载的是7的版本 2. 下载ubun ...

  9. codeforces 练习

    codeforces 627 D. Preorder Test 二分 + 树dp 做logn次树dp codeforces 578D.LCS Again 给出一个字符串str,长度n<=10^6 ...

  10. Windows安装Node.Js

    1.下载https://nodejs.org/ 2.安装 3.修改环境变量,添加安装的Node.js的目录(此处似乎可以不用配置) 4.查看npm指令 关于npm介绍“Nodejs自身提供了基本的模块 ...