My handle_info callback for GenServer is not called.
Here is the code:
On line 18 in init I send myself a :kickoff message but the callback is not invoked.
The same code was working when my top-level module used the Application behaviour.
But I needed command-line arguments and restructured the code - I parse my arguments in the CLI module and pass them to the Application module which just calls Supervisor.start_link. And it stopped working and I can’t figure out why.
The 0 in send_after is not intended as a message - its the timeout.
I want to just finish initialization and handle the :kickoff message immediately after that, using the workers_count (which is my state) to launch this number of workers.
On a side note, recent Elixir and Erlang versions ship with “handle_continue” which you may want to use instead of custom kickoff message sent from init. Not much of functional change but a nice syntax designed to do initialization specifically after process is started.