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.
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
[Python] Allow to run pure Python request middlewares inside a Tower service #1734
Changes from 30 commits
d1d74fe
da9e052
aeeaa89
e20563e
583c967
047401c
88bbd11
aa2dc0a
5e784f6
03c660b
28e3c09
f3e21de
84cc06b
78a6b6f
38d971c
cf7521d
80cdbfc
e79797f
b08d331
959b02c
8415503
37036b8
1d51bb8
2a00ec2
5e6bfe2
c3c2d65
e75d2db
1cddc95
324e30f
34c55f1
fb58bdf
e06d7d7
8f98141
964a470
4ee2743
b9a8e3b
433c162
747b6c0
da065a4
6c1f9ab
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This method is handy if you prefer this style https://docs.rs/tracing/latest/tracing/struct.Span.html#method.entered
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