Erts/Otp onLoad

Tony Rogvall tony@REDACTED
Wed May 19 22:19:06 CEST 2004

onsdagen den 19 maj 2004 kl 10.29 skrev Bengt Kleberg:

> Tony Rogvall wrote:
>> Hello list!
>> I have a small suggestion for new functionality in the Erlang/Erts 
>> [Otp] system.
>> I would like to see that a call to a function called M:onLoad() (or 
>> something) was
>> made by the runtime system when a module M that exports such a 
>> function was loaded
>> and before any other code was executed (not a requirement).
> is this similar to how*|Module:code_change() works for gen_<behaviour> 
> ?
Not really, the code_change is called from upgrade scripts when 
upgrading gen_server's,
the onLoad should be called by the runtime system (or code server) when 
a module is loaded.

onLoad could of course be used for such purposes if onLoad is 
implemented correctly.


More information about the erlang-questions mailing list