推荐学习书目
› 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
Livid
396.81D
539.6D
V2EX  ›  Python

一篇关于 Python ASGI 的介绍

  •  
  •   Livid ·
    PRO
    · Nov 6, 2021 · 4438 views
    This topic created in 1784 days ago, the information mentioned may be changed or developed.
    6 replies  •  2021-11-07 13:33:47 +08:00
    ericls
        1
    ericls  
       Nov 6, 2021 via iPhone
    18 年试手写了一个框架
    ASGI 目前最大的优势是很多工具的 signature 都是一样的
    ericls
        2
    ericls  
       Nov 6, 2021
    WSGI 的 signature `simple_app(environ, start_response)`, 所有的框架在包装的时候都没有暴露,而 ASGI 整个生态比较统一
    wellsc
        3
    wellsc  
       Nov 6, 2021 via Android
    为什么那“时代变了”的回复被删了?
    ClericPy
        4
    ClericPy  
       Nov 6, 2021   ❤️ 1
    all-in 协程两年了, 强制关闭在运行的协程时候真香, 比线程灵活太多了. 就是 handle int signal 的时候遇到 subprocess 有点难受, 没在外层截住直接顺便传递给子进程里了... 还在继续折腾

    话说协程招人真难啊, 虽然面的人里 2.7 的少了, 但都 3.6 不用协程的...

    项目里提到的 Mangum 得去试试, 貌似能少写不少 lambda 的 API gateway 部分
    est
        5
    est  
       Nov 6, 2021
    其实 uvicorn 写得并不完整,fastapi starlette 什么的都只能说玩玩 REST API 。别的都不行。
    abersheeran
        6
    abersheeran  
       Nov 7, 2021
    @ericls 确实,Starlette 带了一个好头,我很喜欢那个设计,所以我也给 WSGI 整了一个 https://baize.aber.sh/wsgi ,写一些小玩意的时候很爽,很多 Serverless 都直接支持 WSGI 。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1082 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 23:30 · PVG 07:30 · LAX 16:30 · JFK 19:30
    ♥ Do have faith in what you're doing.