-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)c apiThis has to do with the C API (_view)This has to do with the C API (_view)delayedDelayed due to another issueDelayed due to another issuefeatureNew featureNew feature
Milestone
Description
Feature description
For compatibility with ASGI toolkits like Starlette, view.py should make it possible to defer the ASGI scope
, receive
, and send
. This will allow someone to for example, mount an existing Starlette app against a view.py server, which very much aligns with batteries-detachable.
Feature example API
from starlette.responses import PlainTextResponse
from view import new_app
app = new_app()
@app.defer("/prefix")
async def starlette_app(scope, receive, send):
assert scope['type'] == 'http'
response = PlainTextResponse('Hello, world!')
await response(scope, receive, send)
app.run()
Anything else?
This will be waiting on #82, as prefixing will require path parameters.
Metadata
Metadata
Assignees
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)c apiThis has to do with the C API (_view)This has to do with the C API (_view)delayedDelayed due to another issueDelayed due to another issuefeatureNew featureNew feature