Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coming off the discussion re: the worker manager, I implemented the idea of adding a request counter. I thought of a few different strategies. Most important to me was that it not be forced upon users who do not opt in.
The obvious first choice was of course
config
. But, I do not want to even include a check for this on every request. I thought about using a touchup scheme, but we do not have one that is currently setup for general conditional checks. Maybe we should, but that is outside the scope here.Doing it on
Request.__init__
is the easiest. So, I thought perhaps as a subclass we can get the result without any of the consequences. It does however bring the question about whether a self-contained opinionated piece of logic belongs in the main project at all, or if it should be pushed over to Sanic Extensions.Thoughts?
Implementation:
FYI - the result will show in the worker state