-
Notifications
You must be signed in to change notification settings - Fork 887
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 a RouteFound event which will fire after a route is found #1876
Conversation
That sounds incredibly useful. |
Hmm, I guess I would have solved the problem by configuring a "root factory" for the read-only routes which set up the correct isolation. If others don't object to the event (I don't mind it), the PR will need test coverage and narrative / API docs to accompany the new feature. |
Yea, I will absolutely write docs and tests! Just wanted to get opinions before I bothered. |
👍 I like this idea. |
@dstufft You should definitely write the docs and tests :) 👍 |
Reading the issue #1875 it looks like @mmerickel might be onboard if this was renamed to |
I'm going back and forth right now but I think The issue with |
In my PR it is only executed when a route is found I believe, I don't have a major opinion on |
I've chewed on this some more. If you rename it to |
I've pulled this down, and renamed it, and pushed it as a new branch to this repo so that any further changes can be made on this PR directly: #2469. |
Fixes #1875
Opened this up for discussion on the implementation, this allows something like:
You can then set a route as a "read only" route that will have a read only transaction for it. This can't be done in a decorator or a view mapper or a tween because it needs to occur before the context is looked up (because that may or may not trigger a database query, and if it does you can't change the isolation level). This is important if you're using a strict isolation level so you can have read only views take a less invasive lock.