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

Eager module initialization on application startup #15

Open
mbeckem opened this issue Apr 24, 2021 · 0 comments
Open

Eager module initialization on application startup #15

mbeckem opened this issue Apr 24, 2021 · 0 comments
Labels
idea Proposals that have not been committed to yet

Comments

@mbeckem
Copy link
Owner

mbeckem commented Apr 24, 2021

The current implementation of module loading is lazy, i.e. the module initializer is executed when a module is imported for the first time.
Initialization should be eager instead, with an explicit start() call once all modules have been registered with the vm.
This would ensure an application finishes initialization correctly and does not error out unexpectedly on, for example, the first request.

Pseudocode:

vm.register_module("a", ...);
vm.register_module("b", ...);
vm.start(callback); // init all modules in the dependency graph, respecting module dependencies
@mbeckem mbeckem added the enhancement New feature or request label Apr 24, 2021
@mbeckem mbeckem added idea Proposals that have not been committed to yet and removed enhancement New feature or request labels Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Proposals that have not been committed to yet
Projects
None yet
Development

No branches or pull requests

1 participant