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

Optimization for bracketHandler: skip acquire and release actions when they're not needed #188

Open
kaol opened this issue May 6, 2017 · 0 comments

Comments

@kaol
Copy link
Contributor

kaol commented May 6, 2017

I think bracketHandler could be more intelligent with regard to snaplets' behavior. Using it on Heist (for example) makes the acquire and release actions run for url patterns that it has no templates for and as such would never accept. It would never invoke any user splice code in such a case. Any reasonable pair of acquire and release actions should be a no op in such a case, besides wasting some resources. It would be a nice optimization for Snap for it to skip using them in such a case.

I'm not quite sure how to go about implementing something like this. A Handler, as a monad, is opaque to whether it would reject a particular url and by the time it returns empty the acquire action has been called already.

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

1 participant