This is the code I have:
handle_cast(start, #state{started = false} = State) -> gen_server:cast(self(), add_process), {noreply, State#state{started = true}}; handle_cast(add_process, State) -> ...
Is it possible to call gen_server:cast from insinde in the handle_cast function? I expect this to cause handle_cast return a new state, and then the add_process message will be processed immediately.
source share