Skip to content
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

Add ASGI BASED Middleware #348

Open
bensarifathi opened this issue May 2, 2023 · 2 comments
Open

Add ASGI BASED Middleware #348

bensarifathi opened this issue May 2, 2023 · 2 comments

Comments

@bensarifathi
Copy link

Note: consider using Discussions to open a conversation about new features…

🚀 Feature Request
am trying to use this library https://github.com/melvinkcx/fastapi-events which use an ASGI middleware and when i tryed to add this middleware to my app i got the following error:
AttributeError: 'EventHandlerASGIMiddleware' object has no attribute '__qualname__'

Middleware call signature: async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:

@RobertoPrevato
Copy link
Member

Hi @bensarifathi
BlackSheep does not support currently middlewares that use the ASGI signature, because it has its own code API to work with requests and responses.

I don't like very much the idea of supporting that other way to describe middlewares, because then to follow the same logic blacksheep should also support ASGI way of defining request handlers. I already took this into consideration in the past.

I might reconsider but I have other things on my TODO list and started.

@Klavionik
Copy link
Contributor

Actually, I'm struggling right now to wrap a Blacksheep app into a few ASGI middlewares. It would be nice to have such a feature. ⚡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants