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

Allow `@RequestScope` on method declarations #14

Open
wolfgangmeyers opened this issue Apr 13, 2016 · 1 comment
Open

Allow `@RequestScope` on method declarations #14

wolfgangmeyers opened this issue Apr 13, 2016 · 1 comment

Comments

@wolfgangmeyers
Copy link
Contributor

@wolfgangmeyers wolfgangmeyers commented Apr 13, 2016

When using dagger to inject the current route, it would be useful to reuse that route within the scope of the request so that the router isn't invoked multiple times. According to https://guides.codepath.com/android/Dependency-Injection-with-Dagger-2#scopes dagger module @Provides methods will be called repeatedly without caching the result: "Scope annotations cause dagger to hold a single instance of the provided object in a given component. Provider methods that do not have a scope specified will be called to create a new object every time that the given type is injected."
In order to cache request scoped objects, @RequestScope should allow METHOD targets so that it can be added to @Provides annotated methods in dagger modules.

@wolfgangmeyers
Copy link
Contributor Author

@wolfgangmeyers wolfgangmeyers commented Apr 13, 2016

#15

Falkenfighter pushed a commit to DonutsInc/nomulus-public that referenced this issue Nov 7, 2016
bazel HEAD appears to be incompatible with the version of dagger
we were running. This change updates the donuts domain-registry
to use the same version of dagger used by the google/domain-registry
project (as of today)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.