Discussion about uses for Agent Processes

Hmm, I’d probably have stuffed that record into the state (or ‘as’ the state if nothing else).

Wait, how do you do this? Adding functions to an Agent basically just means a GenServer, so why not just have it all in a GenServer?

Yeah, that should be a GenServer, you only add things to that GenServer that relate to messing with its own state.

That could also be another GenServer, but you would not need to keep the transformation for the agent in ‘this’ genserver but could keep it with the data itself in the other genserver directly.

Hmm, how does this work? Code examples?

1 Like