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
This is however not thread safe, so we sometimes experience that when we call instance on the Provider it will crash with a: If accessing container from multiple threads, make sure to use a synchronized resolver.. As I can read from the code this is because some other resolve might have occurred simultaneously with this, and because the Resolver isn't synchronised in the factory methods it isn't thread safe .
I have been able to fix this issue by replacing the above code with something like:
however that seems wrong, in that it feels like I am creating a cyclic dependency on the container, and also I am not sure that any registrations made after this would be part of the scope of the inlined container, which would result in invalid resolves.
Am I hitting a bug? If so I can try to see if I can fix it, or is there something I am misunderstanding, if so I can try and update the documentation so others won't hit the same issue.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
In the app I am working on we often do registrations in Assemblies like so:
This is however not thread safe, so we sometimes experience that when we call
instance
on the Provider it will crash with a:If accessing container from multiple threads, make sure to use a synchronized resolver.
. As I can read from the code this is because some other resolve might have occurred simultaneously with this, and because theResolver
isn't synchronised in the factory methods it isn't thread safe .I have been able to fix this issue by replacing the above code with something like:
however that seems wrong, in that it feels like I am creating a cyclic dependency on the container, and also I am not sure that any registrations made after this would be part of the scope of the inlined container, which would result in invalid resolves.
Am I hitting a bug? If so I can try to see if I can fix it, or is there something I am misunderstanding, if so I can try and update the documentation so others won't hit the same issue.
The text was updated successfully, but these errors were encountered: