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
Elixir - valentine edition
Search
Saša Jurić
February 14, 2017
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elixir - valentine edition
Saša Jurić
February 14, 2017
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
210
Simplifying systems with Elixir - Belgrade
sasajuric
3
490
Simplifying systems with Elixir
sasajuric
2
620
Metagrokking Elixir
sasajuric
4
330
Solid Ground
sasajuric
15
1.3k
Solid Ground
sasajuric
3
940
What's the fuss about Phoenix?
sasajuric
2
1.2k
Phoenix
sasajuric
1
280
Phoenix
sasajuric
0
170
Other Decks in Programming
See All in Programming
信頼性の目標を誰も求めてない
shubox
0
480
typoなんかねぇよ
raspython3
0
660
初めての模倣学習とVLA
natsutan
0
440
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
290
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
960
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
340
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
620
What We Talk About When We Talk About XP
m_seki
2
290
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
160
業務時間外もAIに働いてもらう話
colorful12
3
9.9k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
180
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Embracing the Ebb and Flow
colly
88
5.2k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
680
Prompt Engineering for Job Search
mfonobong
0
430
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
GraphQLとの向き合い方2022年版
quramy
50
15k
Documentation Writing (for coders)
carmenintech
77
5.5k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
A better future with KSS
kneath
240
18k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Transcript
Elixir @sasajuric aircloak.com
None
None
otpornost na pogreške skalabilnost responzivnost
Erlang LFE Elixir Erlang VM (BEAM)
None
v1 = f1(p1, p2, ...) v2 = f2(...) ...
spawn(fn -> ... end) A B
OS proces BEAM proces
scheduler scheduler scheduler scheduler BEAM instanca CPU CPU CPU CPU
pid = spawn(fn -> ... end)
pid = spawn(fn -> ... end) send(pid, :ping)
spawn(fn -> receive do :ping -> # ... end end)
send(pid, {:ping, self()})
spawn(fn -> receive do {:ping, caller_pid} -> send(caller_pid, :pong) end
end)
send(pid, {:ping, self()}) receive do :pong -> # ... after
:timer.seconds(5) -> # ... end
pid = spawn(fn -> server_loop(state) end)
defp server_loop(state) do receive do message -> new_state = handle(state,
message) server_loop(new_state) end end
bank account balance
send(pid, {:deposit, 100}) send(pid, {:withdraw, 100}) send(pid, {:balance, self()}) receive
do balance -> # ... end
spawn(fn -> bank_account_loop(0) end)
def bank_account_loop(balance) do receive do {:deposit, amount} -> bank_account_loop(balance +
amount) {:withdraw, amount} -> bank_account_loop(balance - amount) {:balance, caller_pid} -> send(caller_pid, balance) bank_account_loop(balance) end end
bank account {:deposit, amount} {:withdraw, amount} :balance
None
db connection background job request handler state request handler request
handler request handler request handler request handler state state state background job background job background job db connection db connection db connection
A B C D E F
A exit notifikacija B C D E F
S S S W W S W W W S
W W
VM VM VM VM VM
VM send(pid, message) VM 1 send(pid, message) VM 2
elixir-lang.org phoenixframework.org adventofcode.com exercism.io elixirforum.com meetup.com/lambdazagreb/