-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Consider removing RawContextMiddleware
and keeping only ContextMiddleware
after resolving memory usage issue
#47
Comments
I haven't seen much difference with either middleware. If the original concern is now fixed, the regular |
If the original concern is fixed then the docs need to be updated. I ended up in this issue while trying to figure out what was wrong with |
Hi I am a Starlette maintainer. I highly encourage you to not use use |
Great! I was hoping one of the Starlette maintainers would chime in and help make this decision. Thanks. |
@adriangb can you clarify why would it be encouraged to keep using |
I think it's best to link to discussions already existing in Starlette: encode/starlette#1729. There are really no benefits to |
In the next minor release, we're getting rid of it. The deprecation warning is already there. Thanks for linking the related discussion. |
Thank you @adriangb for the context link! |
I like
ContextMiddleware
because it's very simple to understand and expand, even for minds that are not familiar withasync
Python.Some time ago it was advised #18 to add
RawContextMiddleware
and Starlette maintainers were discouraging the use of the built-in middleware. I was surprised to see 3 ❤️ reactions under this issue so I think a few people had problems with it.Fast-forward almost a year, the issue encode/starlette#1012 (comment) with memory usage has been closed.
If there's no point in keeping both, I'd be happy to remove the more complicated one but I will wait for some confirmations from the community. If there's a case when it makes sense to use
RawContextMiddleware
, then I'd keep both.What's your opinion about that? @hhamana @dmig-alarstudios
The text was updated successfully, but these errors were encountered: