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

Robert Virding rvirding@REDACTED
Fri Apr 14 02:17:07 CEST 2017


Sorry missing something here, and init/1 function in what?


On 7 April 2017 at 14:06, Dmitry <mbike2000ru@REDACTED> wrote:

> Hello
>
> 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.?
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170414/d3850869/attachment.htm>


More information about the erlang-questions mailing list