Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OTP in 15 Minutes or Less
Search
Gavin M. Roy
August 04, 2016
Programming
0
160
OTP in 15 Minutes or Less
Slides for my talk given at the Philly Elixir Meetup on the OTP part of Elixir/OTP.
Gavin M. Roy
August 04, 2016
Tweet
Share
More Decks by Gavin M. Roy
See All by Gavin M. Roy
RabbitMQ, Event-Driven Architectures, and Data Warehousing
gmr
3
1.1k
Messaging Standards and Systems: AMQP & RabbitMQ
gmr
4
940
Integrating PostgreSQL with RabbitMQ
gmr
6
1.9k
Sprockets
gmr
2
230
Become a Logging Expert in 30 Minutes
gmr
4
610
An Introduction to Tornado
gmr
7
250
Concurrency with Multiprocessing in Python
gmr
3
390
Other Decks in Programming
See All in Programming
CSC509 Lecture 03
javiergs
PRO
0
330
CSC509 Lecture 06
javiergs
PRO
0
240
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
470
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
3.4k
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
920
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
230
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
190
私はどうやって技術力を上げたのか
yusukebe
43
17k
CSC509 Lecture 05
javiergs
PRO
0
290
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
380
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
180
止められない医療アプリ、そっと Swift 6 へ
medley
1
120
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
5
180
The Pragmatic Product Professional
lauravandoore
36
6.9k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Building an army of robots
kneath
306
46k
Practical Orchestrator
shlominoach
190
11k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
20k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Transcript
OTP in 15 Minutes or Less Philly Elixir Meetup August
2016 Gavin M. Roy VP of Architecture AWeber Communications
Processes • Heart of Concurrency • Are light-weight independent tasks
• Share nothing • Communicate via message passing • Implement a basic contract
Processes • Are long lived in a message loop •
Can link to other processes • Can spawn other processes • Can Crash!
Enter OTP It’s not just what you do, it’s how
you do it
What is OTP? • The standard library that ships with
Erlang • Design principles for code structure • A core set of common patterns and behaviors
OTP Concepts • Applications • Collection of Modules • Runtime
Structure / Processes • Supervisors • Manage Processes • gen_* Behaviors • Releases
Applications • Application Resource File Defines application modules, defaults, and
required OTP applications • Application Behavior start/2 and stop/1 {application, name, [ {description, ""}, {vsn, "1"}, {registered, []}, {applications, [ kernel, stdlib ]}, {mod, {server, []}}, {env, []} ]}.
Supervisors Return a list of Child Specifications that • Defines
the process IDs and MFAs • What to do if processes crashes • How to shutdown the processes • What type of processes the children are
Supervision Tree S W S W W S S W
W W W W
gen_server - init/1 - handle_call/3 - handle_cast/2 -
handle_info/2 - terminate/2 - code_change/3
Other OTP Behaviors Built-In • gen_fsm (Deprecated) Finite State Machine
• gen_statem Event State Machine • gen_event Generic event handling behavior 3rd Party Examples • gen_leader Distributed Master/Slave topology • gen_tcp_server Generic TCP Server • gen_rpc Scalable Multi-node RPC library
Releases • Bundle Application • cli control application • Hot-code
swap upgrade steps
Questions? gmr @crad