The on_load directive name is a function which will run automatically whenever a module is loaded. If we use on_load() function then it is not necessary to export the function because when on_load() function will call it will create a newly spawned process (means: it will generate a new process) and the function must return ok if the module is to remain loaded and become callable.It will generate an exception also causes the module to be unloaded. If the return value is not an atom then a warning error report will be sent to the error logger. and until the on_load() function returns ok the system will not terminated. Syntax: -on_load(Function_Name/0).
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
If the return value is not an atom then a warning error report will be sent to the error logger. and until the on_load() function returns ok the system will not terminated.
Syntax:
-on_load(Function_Name/0).