I’m using Process.send_after to schedule a repeated operation. I’m using a GenServer and receiving the messages in handle_info. All is working fine. To make sure I don’t accidently start multiple timers I am calling Process.cancel_timer in my handle_info function. The strange thing is I am getting a call to handle_info({:cancel_timer, ref, some_bool}, status) which I haven’t implemented so the GenServer crashes. Is this expected? Do I need to do anything in this function or is:
def handle_info({:cancel_timer, _, _}, status) do
{:noreply, status}
end
sufficient?