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

Async plugin loading #54

Open
ylt opened this issue Jul 31, 2015 · 0 comments
Open

Async plugin loading #54

ylt opened this issue Jul 31, 2015 · 0 comments

Comments

@ylt
Copy link
Member

ylt commented Jul 31, 2015

This is a hard one, allow plugins to initialize in parallel. Plugins such as plug can take a while to initialize (in the case of plug, the actual login process is done async, but this can cause issues for plugins which expect plug to be available upon starting).

Change the dependency system to manage this. While we could just patch it into the current dependency system, this is not optimal as it will just be a serial with parallelism just where dependencies happen to align. I'd like to make it so that plugin loading is initiated as soon as the minimal requirements for loading are met.

Probably will involve an extra list to store the loading state, one state will be for plugins waiting to be loaded (waiting for dependencies), another of plugins that are in the middle of loading.

This prevents accidentally loading a plugin twice, also it will allow for queuing up the plugins to start the loading of when the requirements have just been met.

Loading is probably easy enough, but there are several other cases to be handled: if a plugin has failed to start, what to do with dependencies that got loaded as a result, and how to handle the dependencies relying on it? If we try unloading dependencies it may unload plugins the user manually loaded earlier, so reasons should be implemented (manual vs automatic). In terms of dependent plugins, we can scan ahead on the load queue and cancel the ones ahead (maybe with similar load error logic as well, so that their dependencies are cleaned also).

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

No branches or pull requests

1 participant