Tags: sarulabs/di
Tags
Fix issues #36 and #37 relative to the usage of def.Is - Get will now panic if called with a bad parameter instead of returning the first object in the container - The behavior of SetIs changed to avoid calling reflect.TypeOf if the input is already a reflect.Type. It also panics if given a nil interface as its type can not be resolved.
Fix the object closing order (#14) The objects were closed in a random order. It was possible to have an object with a closed dependency. It could lead to useless errors (and error logs). In the worst case the dependency could be a logger and the logs could be lost. The objects are now closed in the right order. The dependencies are closed after the objects using them.
Fix concurrent build calls (#12) Two requests could build the same object in the app scope. The first one was used by the first request, while the second one was used by all the other requests. The first one was forgotten and never closed. It could happen if the first two Get calls were done at the same time or/and if the Build function took some time to be executed.
PreviousNext