You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugins need to be able to communicate with each other (i.e. calling one plugin's command from within another plugin). To be able to do this safely, we also need a concept of dependencies.
I propose supporting dependencies in the following manner:
@depends can be applied to a class, or method to indicate that it is only valid if the dependency has been satisfied (and otherwise cannot be loaded, called, or otherwise accessed.)
cardinal.plugin('users') can resolve optional dependencies (e.g. the "users" plugin). It will raise an exception if the plugin is not loaded. Maybe support for load=True kwarg that can attempt to load the plugin if it isn't loaded -- this must still adhere to blacklist/whitelist settings.
When a plugin is being loaded, we would first check if there are any required dependencies -- if there are, we'll attempt to resolve them recursively. If we fail at any point, the state should be reverted (any plugins in the process of being loaded as a result of a dependency tree will not be loaded). If we succeed, the original plugin will be loaded.
When a plugin command is called which is decorated by @depends, we first check if there any required dependencies, and repeat the same process above.
The text was updated successfully, but these errors were encountered:
Plugins need to be able to communicate with each other (i.e. calling one plugin's command from within another plugin). To be able to do this safely, we also need a concept of dependencies.
I propose supporting dependencies in the following manner:
@depends
can be applied to a class, or method to indicate that it is only valid if the dependency has been satisfied (and otherwise cannot be loaded, called, or otherwise accessed.)cardinal.plugin('users')
can resolve optional dependencies (e.g. the "users" plugin). It will raise an exception if the plugin is not loaded. Maybe support forload=True
kwarg that can attempt to load the plugin if it isn't loaded -- this must still adhere to blacklist/whitelist settings.When a plugin is being loaded, we would first check if there are any required dependencies -- if there are, we'll attempt to resolve them recursively. If we fail at any point, the state should be reverted (any plugins in the process of being loaded as a result of a dependency tree will not be loaded). If we succeed, the original plugin will be loaded.
When a plugin command is called which is decorated by
@depends
, we first check if there any required dependencies, and repeat the same process above.The text was updated successfully, but these errors were encountered: