-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Allow to run pure Python request middlewares inside a Tower service #1734
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
d1d74fe
Initial runtime support for middlewares
crisidev da9e052
Cleanup
crisidev aeeaa89
Codegenerate middleware support
crisidev e20563e
Support responses, errors and header updating in middleware chain
crisidev 583c967
Refactor and make errors consistently working
crisidev 047401c
Fix the ability of changing the request between middlewares
crisidev 88bbd11
Merge branch 'main' into crisidev/oxipy-middleware
crisidev aa2dc0a
Remove unused errors
crisidev 5e784f6
Refactor
crisidev 03c660b
Remove trait
crisidev 28e3c09
Add testing of middleware handlers
crisidev f3e21de
Add end to end test of the service
crisidev 84cc06b
Add end to end test of the layer
crisidev 78a6b6f
Merge branch 'main' into crisidev/oxipy-middleware
crisidev 38d971c
Remove useless dependency
crisidev cf7521d
Remove another useless dependency
crisidev 80cdbfc
Idiomatic logging refactoring
crisidev e79797f
Enable back logging tests
crisidev b08d331
Make clippy happy
crisidev 959b02c
Merge branch 'main' into crisidev/oxipy-middleware
crisidev 8415503
Another nudge for clippy happyness
crisidev 37036b8
Clippy again
crisidev 1d51bb8
Span needs to be only available for not tests
crisidev 2a00ec2
Fix integration tests
crisidev 5e6bfe2
Merge branch 'main' into crisidev/oxipy-middleware
crisidev c3c2d65
Merge branch 'main' into crisidev/oxipy-middleware
crisidev e75d2db
Add documentation and examples
crisidev 1cddc95
Fix test
crisidev 324e30f
Fix kotlin linting
crisidev 34c55f1
Reword middleware to explicitly tell we only support requests so far
crisidev fb58bdf
Update changelog
crisidev e06d7d7
Merge branch 'main' into crisidev/oxipy-middleware
crisidev 8f98141
Apply suggestions from code review
crisidev 964a470
Merge branch 'main' into crisidev/oxipy-middleware
crisidev 4ee2743
Refactor logging for a more idiomatic experience
crisidev b9a8e3b
Merge branch 'main' into crisidev/oxipy-middleware
crisidev 433c162
Remove useless dependency
crisidev 747b6c0
Merge branch 'main' into crisidev/oxipy-middleware
crisidev da065a4
Fix documentation
crisidev 6c1f9ab
Merge branch 'main' into crisidev/oxipy-middleware
crisidev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for removing
tokio::task::block_in_place
is that we are still bound to the mutex on the GIL that is taken inside thePython::with_gil
closure.No matter what we do, this synchronous mutex will not allow tokio to continue the execution.
Removing
block_in_place
yields a significant performance improvement since it removes the overhead of scheduling new tasks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other frameworks using the same approach as Smithy-rs Python are also doing the same: sparckles/Robyn@4ef01e6