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

Missing Scope unregistering... :/ #164

Open
Lakedaemon opened this issue Jul 10, 2015 · 0 comments
Open

Missing Scope unregistering... :/ #164

Lakedaemon opened this issue Jul 10, 2015 · 0 comments

Comments

@Lakedaemon
Copy link

I looked a bit at the MortarScope code and I'm a bit surprised that scopes can be started at any time after the start of a mortarScope but can only end when the mortarscope is destroyed and not sooner...
Also services start with the mortarScope and end with it, so they can't be stopped or replaced in the same mortarScope

Why is that ? Is there something I don't see ?

Say, your want to store user settings and the user changes them, so you may have :
|-- settings : ONE ---| |------ settings : TWO ----| |------------------- settings:THREE----|

Sure, you can store a user settings holder that takes care of this sub-scoping but wouldn't it be simpler to allow getting a scope and to tear it down from the mortarScope while it is not destroyed ?

Because they can be destroyed, to achieve this, it might be possible too to create a child MortarScope with the name "settings" holding Setting:ONE as a service
... and then destroying it ... and creating another child mortarScope with the same name.....

But it's not simple too

Also, the scoped services that the root mortar scope holds can't be stopped/ replaced before the end of the process.... :/

Am I missing something ?

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