News for hackers. Stuff that matters.
Re:OTP 23 by pythonaut_16 on Thursday May 14, 2020 @11:29AM (#23180710)
I think you are misunderstanding what GenServers are and are for.

GenServers do have their own state, but they are used for way more than just storing state. It's probably best to literally think of it as a server in your running application, analogous to a server running on a network.

If storing state is all you're trying to do you might want to look at Agent or possibly ETS.

Further, GenServers come from Erlang, not Elixir. They're intended to model all sorts of runtime properties of code.

There are no comments on this comment yet.