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
The World is a Network (and We Are Just Nodes)
Search
Andrea Leopardi
May 11, 2024
Programming
0
180
The World is a Network (and We Are Just Nodes)
Slides for my Gig City Elixir 2024 talk.
Andrea Leopardi
May 11, 2024
Tweet
Share
More Decks by Andrea Leopardi
See All by Andrea Leopardi
BEAM: The Perfect Fit for Networks
whatyouhide
1
160
Update from the Elixir team - 2022
whatyouhide
0
370
Testing Asynchronous OTP
whatyouhide
0
480
Elixir Sightseeing Tour
whatyouhide
0
390
Mint - Disrupting HTTP clients
whatyouhide
0
230
BEAM Architecture Handbook
whatyouhide
7
2.7k
The Evolution of a Language
whatyouhide
0
130
Elixir - functional, concurrent, distributed programming for the rest of us
whatyouhide
2
310
Papers we love: Elixir edition
whatyouhide
5
1.1k
Other Decks in Programming
See All in Programming
Beyond ORM
77web
11
1.6k
Оптимизируем производительность блока Казначейство
lamodatech
0
950
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
450
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
1.2k
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.4k
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
For a Future-Friendly Web
brad_frost
176
9.5k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Bash Introduction
62gerente
610
210k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
A Philosophy of Restraint
colly
203
16k
Side Projects
sachag
452
42k
Transcript
None
ANDREALEOPARDI.COM @WHATYOUHIDE
None
@ITALIANCOMMENTS ITALIANS MAD AT FOOD
None
None
None
None
None
None
None
NETWORK PROGRAMMING
None
BANANA 1 BANANA 2 A = TRUE YO, A IS
TRUE GOTCHA
BANANA 1 BANANA 2 A = TRUE YO, A IS
TRUE GOTCHA X
PERSON 1 PERSON 2 A = TRUE YO, A IS
TRUE GOTCHA X
PROCESS 1 PERSON 2 A = TRUE YO, A IS
TRUE GOTCHA X
PROCESS 1 PERSON 2 A = TRUE YO, A IS
TRUE GOTCHA X
None
CLIENT SERVER
DISTSYS 101
CABLES WAVES
BEAM
MSG1 MSG2
MSG1 MSG2
NODE NODE
NODE NODE
MSG ACK
ref = make_ref() send(dest_pid, {ref, self(), msg}) receive do {^ref,
response} -> # ... end receive do {ref, sender_pid, msg} -> response = act_on_message(msg) send(sender_pid, {ref, response}) end
ref = make_ref() send(dest_pid, {ref, self(), msg}) receive do {^ref,
response} -> # ... after 1000 -> :timeout end receive do {ref, sender_pid, msg} -> response = act_on_message(msg) send(sender_pid, {ref, response}) end
None
:gen_tcp.send(socket, "Hello world") {:ok, data} = :gen_tcp.recv(socket, 0, _timeout =
1000) {:ok, data} = :gen_tcp.recv(socket, 0) response = process_request(data) :gen_tcp.send(socket, response)
:gen_tcp.send(socket, "Hello world") receive do {:tcp, ^socket, response} -> #
... after 1000 -> :timeout end receive do {:tcp, socket, data} -> response = process_request(data) :gen_tcp.send(socket, response) end
GENSERVER.CALL/3
None
SERVERS
CLIENT CLIENT
REACTIVE
None
None
SUPERVISORS
None
None
CLIENTS
GEN_STATEM
None
IT'S ABOUT THE GUARANTEES
RESTARTING A PROCESS IS ABOUT BRINGING IT BACK TO A
STABLE, KNOWN STATE. FROM THERE, THINGS CAN BE RETRIED. WHEN THE INITIALIZATION ISN'T STABLE, SUPERVISION IS WORTH VERY LITTLE.
LET IT CRASH™? ...NO
PATTERN MATCHING BINARIES
<<message_id::binary-size(2), qr::1, opcode::4, flag_aa::1, flag_tc::1, flag_rd::1, flag_ra::1, _reserved::3, rcode::4, qd_count::16,
an_count::16, ns_count::16, ar_count::16, answer::binary>> = dns_packet
WHY IS THE BEAM SUCH A GREAT FIT?
None
- ERLANG BLOG POST ABOUT MESSAGE PASSING - MY BLOG
POST ON TCP CONNECTIONS IN ELIXIR - MY BLOG POST ON GEN_STATEM CONNECTIONS - "IT'S ALL ABOUT THE GUARANTEES" BY FRED HEBERT - THOUSAND ISLANDS ELIXIR LIBRARY - END-TO-END ARGUMENTS IN SYSTEM DESIGN PAPER - BINARY PATTERN MATCHING REFERENCE
@WHATYOUHIDE THANK YOU!