-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Allow user provided handlers #177
Comments
@cblegare I like this idea, thanks for proposing it. I started working on a handler for WebSockets that might impact this design, so I think after I have a chance to get the initial WebSocket handler implemented that we can see how to work in configurable handlers - there's a bit of refactoring needed first. It might be a week or two before I can look into this further. |
I've introduced this provisionally in a recent PR using a method similar to what you've demonstrated. It's provisional/undocumented, but you can find an example in https://github.com/jordaneremieff/mangum/blob/main/tests/handlers/test_custom.py. I'm not sure how this will ultimately end up, so I'll leave this issue open for discussion/until I'm sure whether or not to support this going forward. |
This feature is now added. Not considered provisional at this point. |
Hello there!
While investigating #176 I found it could be useful to add user provided handler factories to Mangum. It could look like
In place of:
https://github.com/jordaneremieff/mangum/blob/3f312acb67aac30c07dfb305d3cd1881c59755c4/mangum/adapter.py#L47-L73
In order to accept user-provider handler factories. Would you be interested in this?
The text was updated successfully, but these errors were encountered: