5 ms·
There is another option, using a `Task`. Using child specifications one can pass the function to be executed in the `Task` alongside: children = [ Child
by wolf4earth 7y ago
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.