You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
the configuration action may be invoked more than once, which is not intuitively expected.
If this is the desired behavior, it needs to be documented very clearly. Personally, I would prefer the options manager to deal with concurrency issues and guarantee that the configuration action is only invoked once.
The text was updated successfully, but these errors were encountered:
Isn't it dangerous to assume any default lifetime? I certainly wouldn't expect that the framework to bind singleton for you. Though wouldn't this sort out your issue.
@HaoK I believe @fedotovalex is referring to the case of two threads (e.g. two concurrent requests) invoking .Value concurrently on the same singleton. I just checked and we don't have any code dealing with concurrency? Didn't we have it?
In the current implementation of OptionsManager, if I do something like this:
and then later, from multiple threads:
the configuration action may be invoked more than once, which is not intuitively expected.
If this is the desired behavior, it needs to be documented very clearly. Personally, I would prefer the options manager to deal with concurrency issues and guarantee that the configuration action is only invoked once.
The text was updated successfully, but these errors were encountered: