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
erevus
V2EX  ›  Python

使用了 gevent 的 monkey.patch_all 之后,我新加的 socks 代理功能就不能用了...

  •  
  •   erevus · 2015-05-11 11:19:16 +08:00 · 2950 次点击
    这是一个创建于 3272 天前的主题,其中的信息可能已经有所发展或是发生改变。

    gevent是前人留下的,如果要改成多线程什么的就得重写一次这个地方了
    大神们有没有优美的解决方法

    1 条回复    2015-05-11 11:44:02 +08:00
    noli
        1
    noli  
       2015-05-11 11:44:02 +08:00
    不用多线程,用多进程 gevent.fork

    或者多线程也无所谓,把多线程之间的消息传递用 unix socket 来传递,这样 gevent 依然还是可以多线程扩展的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5098 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 03:51 · PVG 11:51 · LAX 20:51 · JFK 23:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.