4 ms·
I see after I posted you edited to mention Agents, Tasks, Oban, and gen_statem. What do you use gen_statem for? I'll admit its intended use-case has always see
by jolux 3y ago
I see after I posted you edited to mention Agents, Tasks, Oban, and gen_statem.
What do you use gen_statem for? I'll admit its intended use-case has always seemed pretty narrow to me, but maybe I just don't understand it very well.
- throwawaymaths 3y agoI don't use gen_statem, its clunky as hell, does a weird thing with response aliasing, and it's even harder to read than Genserver. Plus I don't need it. I understand why the callbacks in gen_statem are so messed up though, they want you to be able to organize your code by state. Since Erlang and (weakly) elixir requires you to group handle_x callbacks linearly in the module, you can't group by state unless you have a `handle_anything`. It's all so messed up :(