Skip to content
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

Dependencies when destroying a context? #177

Open
billwolckenlmco opened this issue Oct 19, 2015 · 0 comments
Open

Dependencies when destroying a context? #177

billwolckenlmco opened this issue Oct 19, 2015 · 0 comments

Comments

@billwolckenlmco
Copy link

When a context is created, if component A depends on B, then B will be created before A. Is there a way to insure that when a context is destroyed that the dependent is destroyed before the dependency - i.e. A is destroyed before B?

The behavior I'm seeing is the components are destroyed in the same order that they are created, which means that dependencies are destroyed before the components that use them. Hence dependencies get ripped out from under the code that needs them.

My scenario is a component which writes status updates and a database component. The status updater depends on the database, so the database gets created (and connected) before the status updater gets created, so the database is ready before any status updates get written. But on destroy, the database gets destroyed (and the connection closed) before the status updater (since that's the order they were created), so the last status updates error out because the database has been torn down before the status updater has finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant