推荐学习书目
› 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
mrchi
V2EX  ›  Python

Python Celery 任务的 signal 和 handler 该如何选择

  •  
  •   mrchi ·
    mrchi · Apr 19, 2020 · 2137 views
    This topic created in 2361 days ago, the information mentioned may be changed or developed.

    假如我要实现在 task 运行失败后做一些事情,比如修改数据库记录的状态,可以这样实现:

    这两种方式都可以实现需求。请教各位,使用上是否有差异呢?该如何选择呢?

    我的理解

    • task signal 是与 celery app 绑定的;
    • Task.on_failure 是与 Task 类绑定的;
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2520 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:42 · PVG 20:42 · LAX 05:42 · JFK 08:42
    ♥ Do have faith in what you're doing.