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 signals before and after handler execution #2540

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Conversation

ahopkins
Copy link
Member

Adds two new signals:

  • http.handler.before
  • http.handler.after

The purpose of these is to add a sort of middleware alternative that runs before and after the handler is called. http.handler.before will always run after request middleware. http.handler.after runs after the handler has completed. But that may or may not be after response middleware.

@ahopkins ahopkins requested a review from a team as a code owner September 11, 2022 11:34
@codecov
Copy link

codecov bot commented Sep 11, 2022

Codecov Report

Base: 87.475% // Head: 87.479% // Increases project coverage by +0.004% 🎉

Coverage data is based on head (51fcf9f) compared to base (e501028).
Patch coverage: 100.000% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2540       +/-   ##
=============================================
+ Coverage   87.475%   87.479%   +0.004%     
=============================================
  Files           69        69               
  Lines         5621      5623        +2     
  Branches       978       978               
=============================================
+ Hits          4917      4919        +2     
  Misses         509       509               
  Partials       195       195               
Impacted Files Coverage Δ
sanic/app.py 88.825% <ø> (ø)
sanic/signals.py 92.647% <100.000%> (+0.109%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ahopkins ahopkins merged commit d352a41 into main Sep 15, 2022
@ahopkins ahopkins deleted the handler_wrap_events branch September 15, 2022 12:49
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

Successfully merging this pull request may close these issues.

3 participants