-
-
Notifications
You must be signed in to change notification settings - Fork 153
Allow to register services later in depend on list #154
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
Comments
Not sure what you want to do, but have you seen that you can use the ´signalReadyFunction` to manually handle the async synchronisation? |
considering following cases in my file
and later in user's file to replace
Then B will be loaded incorrectly |
you mean because B would still expect AImpl? |
I mean |
ok, two questions:
Even if you need to do it the way you want to you can to that by using manual synchronization. |
For Q1: Register one version of A and then another is a feature may called For Q2: As you can see if there are only few services, manual synchronization would be fine. But once the number grows bigger, it is hard to manage all these sequences |
did you checkout get_it scopes? |
Yes, I understand get_it scopes. But it does not affect the dependency load sequence in my case. |
The point why I mention scopes is that the moment you register new types inside the scope (which can also override previous registrations, allReady can be called again. which also means you can just register A & B again when you want to change the implementation. |
Also if you change the registraration if A, B will automatically use the latest version from then on. if the new registration of A takes some time you can await it with |
This works when there are just A and B |
ok, tons of Services, and you want to switch all of the implementations at runtime to different times? |
As a first party package developer, it's easy to change the source code, Thanks for your patience! |
If you have a concrete idea how we could support this better perhaps we can do this. But I would need a better understanding for the use case. |
This may be resloved #155 if all futures are scheduled later in |
I am writing some modularity packages which allows developers to customize each classes by replacing services in DI.
The current implementation check depend on list when register services function is called.
I think it is more reasonable to construct dependency by calling some function like
done
and DFS the tree for async loadingThe text was updated successfully, but these errors were encountered: