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
Map multibindings does not support Lazy #1630
Comments
We'll need to think about the semantics of this. Right now for instance I think we'll always use the same map for |
Just to throw it out there in case it helps someone, this is essentially what |
Thanks @bcorso for explanation! IMO, not providing |
Yeah, I think we mostly agree on that. However, this particular feature is not high priority at the moment so just wanted to mention some possible work arounds.
@hadilq, just curious, is there a particular constraint that prevents you from using |
@bcorso We are trying to reduce usage of |
Currently Map multibindings can provide:
Map<Key, Value>
Map<Key, Provider<Value>>
I would like it to also provide:
Map<Key, Lazy<Value>>
Right now we use the Provider method. However our map only needs one instance of each Value. If we scope the Value we get one instance. If we leave Values un-scoped we get a new instance every time we access the map. Ideally each Value could be left un-scoped since they contain no state, but now we are creating many new instances of these objects unnecessarily.
The text was updated successfully, but these errors were encountered: