V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ray1888
V2EX  ›  Python

python3 async 与 Tornado , aioredis, celery 结合使用问题

  •  
  •   ray1888 ·
    ray1888 · 2018-07-04 21:11:58 +08:00 · 3727 次点击
    这是一个创建于 2094 天前的主题,其中的信息可能已经有所发展或是发生改变。

    需求是这样,启动的时候 celery 订阅一个 channel 用于接收信号 ,需要在 tornado 的触发某个路由之后,然后使用 aioredis 进行订发布,修改每个 celery 里面的进程的某个变量。 问题:

    1. 在 python3 下面,aioredis 与 Tornado 的结合使用会有一定的问题,Tornado 出现假死,不接收请求,如何解决?
    2. celery 有办法能运行 aioredis 来进行订阅吗?因为我想是如果没有收到 Redis 的特定 channel 发布时,他会照这正常的 celery 一样,接收对应的请求
    4 条回复    2018-07-05 09:37:17 +08:00
    owenliang
        1
    owenliang  
       2018-07-04 21:46:10 +08:00 via Android
    py 做复杂异步程序是束手束脚了。
    so1n
        2
    so1n  
       2018-07-04 22:21:48 +08:00
    请问你是 aioredis 的 pool 假死吗?
    ray1888
        3
    ray1888  
    OP
       2018-07-04 23:01:50 +08:00
    @so1n 不是 pool 假死,是加载完路由之后,再请求就假死了
    ackfin01
        4
    ackfin01  
       2018-07-05 09:37:17 +08:00
    我这边用 tornado+peewee_async(aiopg) 也出现过假死 不知道什么原因
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3422 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:36 · PVG 18:36 · LAX 03:36 · JFK 06:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.