phusion / passenger

A fast and robust web server and application server for Ruby, Python and Node.js
https://www.phusionpassenger.com/
MIT License
5.01k stars 547 forks source link

Python asgi support #2272

Open kudlatyamroth opened 4 years ago

kudlatyamroth commented 4 years ago

Feature request

Question 1: What is the problem?

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def read_root():
    return {"Hello": "World"}

this is whole sample, FastApi not come with wsgi, only have asgi module

Question 2: Passenger version and integration mode:

6.0.4/nginx

Question 3: OS or Linux distro, platform (including version):

Manjaro x86_64

Question 4: Passenger installation method:

Your answer: [ ] RubyGems + Gemfile [ ] RubyGems, no Gemfile [ ] Phusion APT repo [ ] Phusion YUM repo [ ] OS X Homebrew [x] source tarball [ ] Other, please specify:

Question 5: Your app's programming language (including any version managers) and framework (including versions):

Python 3.8 FastApi 0.54.1

Question 6: Are you using a PaaS and/or containerization? If so which one?

no

CamJN commented 4 years ago

Thanks for the suggestion!

ionescu77 commented 3 years ago

Hello, happy with passenger (mod_passenger apache) workflow. I am also curious about python async / django asgi support.

ionescu77 commented 3 years ago

Has anybody tried this?

https://github.com/stuxcrystal/passenger_asgi

joshlsullivan commented 3 years ago

I'm interested in this too!

criess commented 2 years ago

Hey, we are currently using a2wsgi from https://github.com/abersheeran/a2wsgi to emulate an wsgi interface but as i can understand you loose all the async features because the adapter will wait (pretty inefficient) until asgi yields a response. Haven't tried the https://github.com/stuxcrystal/passenger_asgi so far, but it seems to do similar.