Repository used during this presentation about
The aim was to demystify GenServer.
git checkout 802f7aa
We just have a simple helper module. We are just going to create a simple TODO list process. We should be able to:
- create a TODO list;
- add new items;
- remove an item;
- mark an item as done;
- get the items;
git checkout 9f788ca
git checkout 0e32b1f
git checkout 78e87e7
git checkout 0778340
We can now compare how we would implement our TODO list using the real GenServer behaviour.
As we can see they look very similar. Of course, our implementation is very naive and we should always use the real GenServer implementation but, at least, we now understand what happens underneath.