[erlang-questions] How to force init/1 to start at application start

Dmitry mbike2000ru@REDACTED
Fri Apr 7 14:06:08 CEST 2017

I have an init/1 function which does not start at application startup.

init([Ref, Socket, Transport, Opts]) ->
    MyTable = ets:new(myphone, [set]),

    MyTable2 = ets:new(socket1, [set]),    lager:start(),
  Timer = erlang:send_after(1210000, self(), check),
    {ok, #state{ref=Ref, socket=Socket, transport=Transport, opts= Opts, dict = MyTable, dict2 = MyTable2, timer = Timer}, 0}.

How to force it to start at an application startup and only once.?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170407/0015bd9e/attachment.htm>

More information about the erlang-questions mailing list