Unlocking the Potential of OTP: Proven Strategies for Application Dev
summary
Shows concrete patterns and measurable results: uses Task.async_stream and a Task.Supervisor to run email sends and currency fetchers concurrently (different PIDs for each worker), converting a 10s sequential flow to reduced 10s to 4s; demonstrates that placing heavy work in an Agent blocks the caller (Agent blocks caller with 4s work); moves initialization work into a GenServer using GenServer handle_continue avoids startup blocking; and wires tasks under supervision so Task.Supervisor restarts failed email sends for fault tolerance.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:49Elixir and core features
- 7:08Functional programming in Elixir
- 13:30Elixir processes
- 17:05OTP purpose
- 18:10OTP Task module
- 23:06Task module demo
- 29:51OTP Agent module
- 34:32OTP GenServer
- 41:55Summary
- 42:40Q&A
related talks
45mTesting Asynchronous OTP
47mOTP
20mUsing OTP in Your Phoenix App
39mPilgrim's Progress to the Promised Land
46mEliminating Single Process Bottlenecks with ETS Concurrency Patterns
23mElixir GenServer: Understanding Elixir concurrency model
42mProcess signals in OTP 21
35mLeveling up your Phoenix Projects with OTP
