tobymao / saq

Simple Async Queues
https://saq-py.readthedocs.io/en/latest/
MIT License
532 stars 37 forks source link

Add mountable Starlette web app #79

Closed grigi closed 1 year ago

grigi commented 1 year ago

For use in anything that is derived from Starlette.

For Starlette:

from saq.web.starlette import saq_web
from starlette.routing import Mount

routes = [
    ...
    Mount("/monitor", saq_web("/monitor", queues=all_the_queues))
]

For FastAPI:

from fastapi import FastAPI
from saq.web.starlette import saq_web

app = FastAPI()

app.mount("/monitor", saq_web("/monitor", queues=all_the_queues))

Also:

Outstanding:

tobymao commented 1 year ago

@grigi do you want to become a maintainer?

tobymao commented 1 year ago

what’s the use case of this change? saq is meant to run alone in aiotthp

grigi commented 1 year ago

@grigi do you want to become a maintainer?

Um... maybe? But not right now.

what’s the use case of this change? saq is meant to run alone in aiotthp

We want to be able to mount the web UI in our internal http api, which is implemented in FastAPI. That will simplify network routing.