Poorman's gen_server
summary
A talk traces evolving a hand-rolled Erlang TCP server from a simple recursive-loop state through records and maps, adding helper message APIs and random refs for request/response matching and using monitors and try/catch for robustness. The implementation is pushed to production but proves brittle and untested, leading to a refactor into an OTP-style gen_server module with proper file-descriptor cleanup and supervision trees, which exposes gaps in tooling, monitoring and testing that motivate adopting OTP.
AI-written summary · about
chapters (16)
- 0:00Start gen_server
- 1:13First TCP server
- 4:07State in processes
- 6:39Process communication
- 9:28Process liveness
- 12:43Fetching server values
- 14:09Out-of-order messages
- 17:21Random ID solution
- 19:50Unexpected messages
- 20:32Proper termination
- 23:03Try-catch usage
- 24:27Reducing repetition
- 25:53Supervision trees
- 28:43Logic separation
- 30:51OTP benefits
- 31:35Q&A
related talks
41mLearn Elixir by Building a Real Time CLI Chat App (Part 5)
23mSticky Ruby
40mTechniques for Metaprogramming in Erlang
53mBuilding Performant Backends with Elixir
35mThe little server that could
36mThe Little Server That Could
26mLearn Elixir by Building a Real Time CLI Chat App (Part 4)
43mMonads: Exploring Railway Oriented Programming in Ruby
