Hello,
Within a genserver, if a function needs to call another server function, would you write:
def handle_cast({:fetch, name}, state) when is_string(name) do
GenServer.cast(name, {:fetch, Model.new(name)})
{:noreply, state}
end
def handle_cast({:fetch, model}, state) do
intern_method(model)
{:noreply, state}
end
OR
def handle_cast({:fetch, name}, state) when is_string(name) do
intern_method(Model.new(name))
end
def handle_cast({:fetch, d}, state) do
intern_method(d)
end
We have a disagreement with a coworker.