modulemanager: Allow modules to expose module.ready - to be called after init
This is a shortcut for module:on_ready() which exposes the functionality in an
idiomatic way consistent with module.load, module.unload, etc.
module.ready runs when the module is loaded and the server has finished
starting up.
--- a/core/modulemanager.lua Thu Nov 30 10:07:53 2023 +0000
+++ b/core/modulemanager.lua Thu Nov 30 10:09:47 2023 +0000
@@ -293,6 +293,10 @@
ok, err = do_load_module(host, module_name);
end
end
+
+ if module_has_method(pluginenv, "ready") then
+ pluginenv.module:on_ready(pluginenv.module.ready);
+ end
end
if not ok then
modulemap[api_instance.host][module_name] = nil;