The Best of Both Worlds: OTP Applications with Elixir
summary
Presents an Elixir OTP implementation of an APNs push notification module: a GenServer-based pns module that opens SSL sockets to Apple Push, sends notifications per device, and is organized under a Supervisor tree using init/handle_call/terminate hooks and restart policies. Shows a proof-of-concept and explains that a single process is too slow for thousands of devices, so the pragmatic solution is a pool of worker processes (using poolboy or a hand-rolled pool) with dynamic supervision and tuned restart strategies.
AI-written summary · about
chapters (17)
- 0:00OTP and Elixir relevance
- 3:00What is OTP and why use it?
- 5:31OTP apps: structure and lifecycle
- 7:20Demo: basic OTP app
- 9:09Elixir processes: Tasks vs GenServers
- 10:32GenServer: generic server
- 14:04GenServer for push notifications
- 16:54Error handling and process restart
- 19:11Supervisors: OTP backbone
- 21:38Supervisor.Spec configuration
- 22:50Demo: supervision tree in Observer
- 24:17Dynamic supervision and restart
- 26:40Dynamic supervision use cases
- 28:47Handling multiple processes
- 30:57OTP apps with Phoenix
- 32:02Other OTP behaviors and resources
- 33:26Summary and FAQ
related talks
12mObject Oriented Thinking with Elixir and OTP
50mA Peek Inside Erlang's OTP
52mKeynote: Pilgrim's Progress to the Promised Land
41mIdioms for building fault-tolerant applications with Elixir
53mIdioms for Building Distributed Fault-tolerant Applications with Elixir
01h 01mThe Erlang Ecosystem
40mJumping gen_servers! A new way of building (...) applications
38mOTP, the Middleware for Concurrent Distributed Scalable Architectures
