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

一个使用gevent实现的异步读写文件的模块

  •  
  •   phuslu · Mar 10, 2012 · 6573 views
    This topic created in 5202 days ago, the information mentioned may be changed or developed.
    起源与我在水木上参与的一个讨论:
    http://www.newsmth.net/bbstcon.php?board=Python&gid=87159

    到现在已经完成了,实现很简单,不过还是比较好用的。
    https://github.com/phus/gevent-asyncfile
    4 replies    1970-01-01 08:00:00 +08:00
    phuslu
        1
    phuslu  
    OP
       Mar 10, 2012
    从PyCon 2012看来,今年应该是gevent的爆发年。
    https://www.google.com/search?hl=zh-CN&q=gevent+site%3Apycon.org

    这点在近期python-cn社区的讨论中也可以得到印证。
    ayanamist
        2
    ayanamist  
       Mar 12, 2012
    我怎么看了看代码,觉得这种异步的方式对性能不会有提高。
    另外用了fcntl,应该就放弃支持Windows了。所以目前真正的跨平台异步方案似乎还是只有NodeJS(在Win上用了IOCP)
    hewigovens
        3
    hewigovens  
       Mar 12, 2012
    1楼的链接404了
    phuslu
        4
    phuslu  
    OP
       May 12, 2012
    最新的gevent版本已经加入gevent.fileobject,实现手法和这个是一样的。呵呵。
    https://bitbucket.org/denis/gevent/changeset/131b2c510bb8
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1499 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 16:30 · PVG 00:30 · LAX 09:30 · JFK 12:30
    ♥ Do have faith in what you're doing.