Agent
Simple wrapper of genserver for state
creates child_spec/1 function that start agent directly under a supervisor.
single threaded state management, updates require new object(ETS much more scalable, but agent good for smaller use cases)
genserver with specific functions for get, update, cast that operate on state and combining server and client code into one function
Usage
Considerations
Atomic updates because server fns run one by one
Should therefore put long running processes in client(not inside agent ft calls), because it will block the agent from recieving other calls from other processes
Raw
Keep a process running that loops infinitely maintaining state and sending/recieving messages
Can then register a pid giving it a name avaliable to all
Last updated