V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
PeterD

Mugen - Python3 HTTP 异步请求库

  •  2
     
  •   PeterD ·
    PeterDing · Oct 21, 2016 · 4535 views
    This topic created in 3478 days ago, the information mentioned may be changed or developed.

    git: https://github.com/PeterDing/mugen
    文档: https://peterding.github.io/mugen-docs

    Mugen 是一个运行在 Python3.4+ 的 HTTP 异步请求库。

    现在支持以下特性:

    • Keep-Alive & Connection Pooling
    • DNS cache
    • Sessions with Cookie Persistence
    • Automatic Decompression
    • Automatic Content Decoding
    • HTTP(S) Proxy Support
    • Connection Timeouts

    Mugen 的 api 设计参考了 requests ,如果对 requests 熟悉,使用 Mugen 就基本没有障碍。

    目前 Mugen 只提供 GET, POST, HEAD 三个基本请求,以后会不断增加其他请求方法。

    如果所有的请求只用到 IO ,计算比较少,相对于多线程和多进程,异步 IO 处理是更好的方法。

    Enjoy!

    9 replies    2016-10-21 16:36:51 +08:00
    Dowding
        1
    Dowding  
       Oct 21, 2016
    这名字让我一惊
    lcx412
        2
    lcx412  
       Oct 21, 2016 via iPhone
    小芳,早
    Shared
        3
    Shared  
       Oct 21, 2016
    文档写的好,支持一记
    PeterD
        4
    PeterD  
    OP
       Oct 21, 2016
    @Shared 原谅我蹩脚的英文( ̄∇ ̄;)))
    Shared
        5
    Shared  
       Oct 21, 2016
    @PeterDhttps://peterding.github.io/mugen-docs/#install-from-source-code 这段有 bug ,代码还是 requests 的 XD
    doubleflower
        6
    doubleflower  
       Oct 21, 2016
    又一个轮子啊
    cheetah
        7
    cheetah  
       Oct 21, 2016
    可以和 aiohttp 对比一下?
    PeterD
        8
    PeterD  
    OP
       Oct 21, 2016
    @Shared 改好了,感谢提醒
    johnhosimple
        9
    johnhosimple  
       Oct 21, 2016
    支持一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1098 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 17:56 · PVG 01:56 · LAX 10:56 · JFK 13:56
    ♥ Do have faith in what you're doing.