News for hackers. Stuff that matters.
Re:Where do I put startup code in Elixir? by wolf4earth on Thursday December 12, 2019 @02:51AM (#21770090)
There 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.