-
-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1534 Changes proposed in this pull request: - Adds a "native" async app based on lower level Starlette tools. It leverages the routing already done in the middleware. - Extracts code related to the parameter decorator out of the Operation objects There's some more work to be done, but this PR is already quite huge, so I wanted to stop at a point where I got all the tests and a simple example working. - Still some general refactoring. I left some TODOs, and the Operation classes are still relied on in too many places. - Sync routes on an Async app should receive async decorators, so they can access the body using `await`. The decorators should then run the sync route in a threadpool to prevent blocking. - We should be able to reuse the parameter decorator for all ASGI apps since we're working with a Starlette Request which we can get directly from the scope and receive channel, which we can make available as context. This means we'll pass Starlette Datastructures to the view functions (eg. FormData, UploadFiles, ...), but if this is opt-in, I don't see any issue with this. - We should be able to reuse the response parsing for Starlette apps as well since it returns a StarletteResponse. - We should test the AsyncApp as well. I'm hoping we can do this quite quickly by generating a test client for it in the fixtures as well, but in the long term some more work will be needed.
- Loading branch information
Showing
47 changed files
with
1,287 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.