Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Dispose services in order #463
Services should be disposed in the reverse order that they were created.
If service A depends on service B, B will be created first, then A. Now when
I have a branch that implements this in our container and adds specification tests but I have couple of concerns:
Thanks for the loop-in! This sounds like another case where making assumptions in the framework could cause issues for some container integrations.
Reverse-order disposal is necessary to correctly tear down some component graphs, e.g. where
If users want forward-order disposal they should be free to depend on it by selecting a container that implements it - and vice-versa. Personally, I feel reverse-order is the right way to do it, but it's highly unlikely everyone agrees with me ;-)
#433 is a discussion along these lines - disposal order would be a good item to add to the summary on that ticket, I think.