How to perform actions periodically with Erlang’s gen_server?
You have two easy alternatives, use timer:send_interval/2 or erlang:send_after/3. send_interval is easier to setup, while send_after (when used in the Erlang module) is more reliable since it is a built-in function, see the Efficiency Guide. Using send_after also ensures that the gen_server process is not overloaded. If you were using the send_interval function you would … Read more