Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think Dave Thomas has a bunch of comments on the elixir forums, and perhaps blog articles and videos too that express a similar problem with GenServers. might be interesting to look those up.

IIRC, one approach he encourages is to at the very least keep most of your logic in a separate module rather than have just a GenServer module that contains a bunch of regular functions and a bunch of handle_<x> functions (which is kind of idiomatic, or at least what I've always been taught).

That said, it's been a while since I followed this discussion so I'd be happy to be corrected.

EDIT: calling a 'public' function in a GenServer and having a handle_<x> function actually deal with it does seem to have an explicitness about it that I think I like. Learning about processes and how they work, I imagine I might've gotten confused if a seemingly normal functional call somehow magically handed things off to a different process.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: