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

最近在学习 gevent,看了官方文档发现没有自己想要的功能

  •  
  •   aladdindingding · Jun 10, 2021 · 2793 views
    This topic created in 1972 days ago, the information mentioned may be changed or developed.

    gevent 有什么办法可以一个协程结束通知另外一个协程直接退出或者是退出正在阻塞的事情么? 即使另外一个协程正在堵塞中。

    目前的实现是使用 gevent.event()

    while True 一下 然后在阻塞的地方加上超时 等什么时候另外一个协程设置了 event.set() 然后这个现在这个协程就退出。

    aladdindingding
    aladdindingding
    OP
    Jun 10, 2021
    1
    或者是两个协程事件绑定,一个退出后另外一个不管运行没有运行完毕也退出
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5567 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 03:08 · PVG 11:08 · LAX 19:08 · JFK 22:08
    ♥ Do have faith in what you're doing.