I have a Phoenix App - what I am trying to achieve is:
- Endpoints
- Each-Endpoints will have their own process
- GenServer to handle those process
- Supervisor to handle this server
defmodule ApiWeb.Supervisor do
use Application
def start(_type, _args) do
children = [
{ApiWeb.Servers.Analytics, :start_link, %{}}
]
opts = [strategy: :rest_for_one, name: SequenceSuper.Supervisor]
Supervisor.start_link(children, opts)
end
end
defmodule ApiWeb.Servers.Analytics do
use GenServer, restart: :transient
@analytics __MODULE__
def start_link(args) do
GenServer.start_link(@analytics, args, name: @analytics)
end
def recently_updated_list() do
GenServer.call(@analytics, {:get_recently_updated})
end
end
and controller functions that will call functions from Servers
Now i am getting an error like