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

Only cache accumulator injection singletons in the variables scope #462

Merged
merged 1 commit into from Dec 13, 2016

Conversation

Projects
None yet
2 participants
@jcberquist
Contributor

jcberquist commented Dec 13, 2016

Updates resolveBean() to keep the accumulator struct (and hence transient beans) out of the variables scope, while still caching injection singletons. Addresses #461.

I also added a check (at new lines 750-753) in the loop through the injection struct to see if each bean there was in the accumulatorCache. My thinking is that if it is, then it is a singleton, and has already had its setters called, and it can be skipped. Otherwise, every time a transient with a dependency on a singleton is retrieved, that singleton is going to have its setters called. This seemed unnecessary to me, but if I am missing something, and the setters need to be called, I can remove the check.

Only cache accumulator injection singletons in the variables scope
Updates `resolveBean()` to keep the accumulator struct (and hence
transient beans) out of the `variables` scope, while still caching
injection singletons. Addresses #461.

@seancorfield seancorfield merged commit 6205098 into framework-one:develop Dec 13, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@seancorfield

This comment has been minimized.

Show comment
Hide comment
Member

seancorfield commented Dec 13, 2016

👍

seancorfield added a commit to framework-one/framework-one.github.io that referenced this pull request Dec 13, 2016

@jcberquist jcberquist deleted the jcberquist:transients-under-load branch Dec 13, 2016

@seancorfield seancorfield modified the milestone: 4.1 Feb 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment