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

Feature request: before/after request methods #118

Closed
upcFrost opened this issue Aug 5, 2020 · 2 comments
Closed

Feature request: before/after request methods #118

upcFrost opened this issue Aug 5, 2020 · 2 comments

Comments

@upcFrost
Copy link

upcFrost commented Aug 5, 2020

Hi,

It'd be really cool to support overridable methods called before and after the request (useful for logging and setting the request context), similar to flask before_request decorator. For myself I've implemented those using functools.partial wrapped around the handler inside the __mapping__ call override, but it'd be great to have a standard way of doing it

@vmagamedov
Copy link
Owner

Currently you can override a call or track beginning of a request using RecvRequest event

@upcFrost
Copy link
Author

upcFrost commented Aug 5, 2020

Interesting, thank you, I'll try using it. Though it's a bit painful that events should be mapped to the server and not to the handler class (those are in two different modules)

@upcFrost upcFrost closed this as completed Aug 9, 2020
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

2 participants