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
0
120
Elixir - valentine edition
Saša Jurić
February 14, 2017
Tweet
Share
More Decks by Saša Jurić
See All by Saša Jurić
Such Great Heights, Code BEAM Lite, Amsterdam 2018
sasajuric
0
160
Simplifying systems with Elixir - Belgrade
sasajuric
3
440
Simplifying systems with Elixir
sasajuric
2
560
Metagrokking Elixir
sasajuric
4
280
Solid Ground
sasajuric
15
1.2k
Solid Ground
sasajuric
3
850
What's the fuss about Phoenix?
sasajuric
2
1.1k
Phoenix
sasajuric
1
210
Phoenix
sasajuric
0
110
Other Decks in Programming
See All in Programming
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
340
情報漏洩させないための設計
kubotak
5
1.4k
Amazon Nova Reelの可能性
hideg
0
230
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
15
2.5k
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
310
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
Vue.jsでiOSアプリを作る方法
hal_spidernight
0
100
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
640
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
9
1.4k
선언형 UI에서의 상태관리
l2hyunwoo
0
270
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
440
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.8k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
343
39k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Become a Pro
speakerdeck
PRO
26
5.1k
Designing for Performance
lara
604
68k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Facilitating Awesome Meetings
lara
51
6.2k
How to Ace a Technical Interview
jacobian
276
23k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Thoughts on Productivity
jonyablonski
68
4.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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/