2 ms·
Where do I put startup code in Elixir?
- wolf4earth 7y agoThere is another option, using a `Task`. Using child specifications one can pass the function to be executed in the `Task` alongside: children = [ Child1, Child2, {Task, &MyModule.run_on_start/0} ] # ... Effectively does the same as using the `handle_continue` of a `GenServer` but in a more clear, straight forward manner.