-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Based on #9
Though it is not set explicitly, each activation function can be static or dynamic
- Static activator is called only once when graph is built. All inactive providers are stripped from graph
- Dynamic activator is called each time we need to decide which provider should be used.
If a dependency has multiple dynamically activated providers they are moved to a temporary component, while new factory is generated.
This factory will call all activators consequently and once it gets True - requests dependency from corresponding factory.
Rules to detect is it dynamic or not:
- async functions are always dynamic
- sync function with no arguments is static
- sync function which requests objects available in Root context is static
- sync function which requests Object which is not registered in graph is static
- sync function dependent on result of other static activators is static
- all other functions are dynamic
Currently, only dynamic calculation is implemented.
Note, that Has() can be evaluated statically only in some cases, though the implementation is generic.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
No status