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
170
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
XP, Testing and ninja testing ZOZ5
m_seki
3
790
CSC509 Lecture 07
javiergs
PRO
0
240
開発生産性を上げるための生成AI活用術
starfish719
3
1.6k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
870
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
110
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
350
Le côté obscur des IA génératives
pascallemerrer
0
150
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
940
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
120
CSC305 Lecture 06
javiergs
PRO
0
270
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
6.7k
EMこそClaude Codeでコード調査しよう
shibayu36
0
290
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
Docker and Python
trallard
46
3.6k
What's in a price? How to price your products and services
michaelherold
246
12k
Git: the NoSQL Database
bkeepers
PRO
431
66k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
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