Here's a quick description of handle_continue/2 from the Erlang gen_server docs [1]:
This function is called by a gen_server process whenever a previous callback returns {continue, Continue}. handle_continue/2 is invoked immediately after the previous callback, which makes it useful for performing work after initialization or for splitting the work in a callback in multiple steps, updating the process state along the way.
So, instead of init returning {ok, State, 0} you have init return: {continue, Continue}. And you will have defined a handle_continue/2 clause whose first parameter will match whatever is in the variable, Continue, and you do whatever work you want done in that clause.
Now, as for why it's not a good idea to use the timeout zero hack, well, here you go (these are Elixir references because that's what Google turned up for me, but it all holds for Erlang as well):
From the Elixir GenServer docs[2]:
Because a message may arrive before the timeout is set, even a timeout of 0 milliseconds is not guaranteed to execute. To take another action immediately and unconditionally, use a :continue instruction.
And, also, from a blog post about handle_continue [3]:
For the problems we looked at, an easier solution is to use the handle_continue callback which was introduced in OTP 21, and guarantees that the process will not accept any messages until the callback is finished. This means that we can still have our asynchronous start up, without having to worry about other messages being processed first.
So, if you want to create a gen_server and then have it do some further initialization and you want this to all be atomic, use handle_continue/2. Otherwise, you run the risk of your new gen_server receiving messages before you've finished that next stage of initialization.
[0] https://livebook.manning.com/book/erlang-and-otp-in-action/c...
[1] http://erlang.org/doc/man/gen_server.html#Module:handle_cont...
[2] https://hexdocs.pm/elixir/GenServer.html
[3] https://medium.com/@tylerpachal/introduction-to-handle-conti...