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
190
0
Share
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
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
970
Integrating PostgreSQL with RabbitMQ
gmr
6
1.9k
Sprockets
gmr
2
240
Become a Logging Expert in 30 Minutes
gmr
4
640
An Introduction to Tornado
gmr
7
270
Concurrency with Multiprocessing in Python
gmr
3
410
Other Decks in Programming
See All in Programming
実践CRDT
tamadeveloper
0
600
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
200
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
160
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
230
의존성 주입과 모듈화
fornewid
0
150
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
890
書き換えて学ぶTemporal #fukts
pirosikick
1
260
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.7k
Back to the roots of date
jinroq
0
540
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
380
Programming with a DJ Controller — not vibe coding
m_seki
3
640
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Designing for humans not robots
tammielis
254
26k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
Docker and Python
trallard
47
3.8k
Skip the Path - Find Your Career Trail
mkilby
1
110
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Exploring anti-patterns in Rails
aemeredith
3
340
Faster Mobile Websites
deanohume
310
31k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
New Earth Scene 8
popppiees
3
2.1k
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