GenServers are a concept directly taken from Elixir.
A GenServer is a process like any other Elixir process and it can be used to keep state, execute code asynchronously and so on. The advantage of using a generic server process (GenServer) implemented using this module is that it will have a standard set of interface functions and include functionality for tracing and error reporting. It will also fit into a supervision tree.
From the Elixir hexdocs
with GenServer from std:syncwith console from std:ioclassCounter< GenServer func! init(state) put {:ok, state} end//If you want to use function matching, you have to explicetly state thisfunc!call(msg, from, state);//We don't need ! since we already stated it abovefunccall(msg :=:get, _, state)put {:reply, state, state} endfunc!cast(msg, state);funccast(msg := {:increment, number}, state)put {:noreply, state + number} endendtryvar {:ok, ctrPid} = GenServer.start(Counter, 0)send(ctrPid, {:increment, 10})var nr = GenServer.call(ctrPid, :get) console.out(nr)//Output: 10catch(e)//ignoredend