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 an IExecutionPolicy #2964

Merged
merged 3 commits into from
Mar 1, 2017
Merged

Conversation

mmerickel
Copy link
Member

@mmerickel mmerickel commented Feb 25, 2017

The goal here is a hook that can actually create new requests. This gives the execution policy the ability to control the execution of a request in pyramid to the extent that it can throw away all state and try again similar to what could be done in middleware.

I'm writing this for the purpose of pyramid_tm which wants to support "retryable" requests in which the request failed for transient reason where there is a reasonable idea that the request will succeed if tried again. When performing a retry we want to teardown state as much as possible to avoid any state leaking from the failing request into the new request (such as managed objects for aborted transactions).

The key difference between this API and a tween is that the execution policy can create a new request with an assurance that nothing else is wrapping it, depending on the old request object and its old state. Whether this is worth the introduction of the API or not is up for debate but I think it is after trying to implement pyramid_tm without it.

@digitalresistor
Copy link
Member

I sent you a PR to fix the docs issue. Besides that, this looks good to me. I am looking forward to this!

@mmerickel mmerickel merged commit 149cb40 into Pylons:master Mar 1, 2017
mmerickel added a commit that referenced this pull request Mar 1, 2017
@mmerickel mmerickel added this to the 1.9 milestone Mar 10, 2017
@mmerickel mmerickel deleted the execution-policy branch November 29, 2020 03:11
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.

2 participants