Here is an example…
@timeout 5 * 60 * 1_000
@impl GenServer
def handle_call(:get_state, _from, state), do: {:reply, state, state, @timeout}
# Timeout handler
@impl GenServer
def handle_info(:timeout, state), do: stop_and_clean(state, {:shutdown, :timeout})
stop and clean is a custom function…






















