What's the best way to do something periodically in Erlang?
I have a process that needs to do some work every fifteen seconds. I'm currently doing it like this: -behavior(gen_server). interval_milliseconds ()-> 15000. init()-> {ok, _State = FascinatingStateData, _TimeoutInterval = interval_milliseconds () }. %% This gets called automatically as a result of our handlers %% including the optional _TimeoutInterval value in the returned %% Result handle_info(timeout, StateData)-> {noreply, _State = do_some_work(StateData), _TimeoutInterval = interval_milliseconds () }. This works, but it's extremely brittle: if I want to teach my server a new message, when