V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
267.72D
571.49D
V2EX  ›  Python

一篇关于 Python ASGI 的介绍

  •  
  •   Livid ·
    PRO
    · Nov 6, 2021 · 3860 views
    This topic created in 1639 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   ·   Solana   ·   2597 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 12:38 · PVG 20:38 · LAX 05:38 · JFK 08:38
    ♥ Do have faith in what you're doing.