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
150
0
Share
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
200
Simplifying systems with Elixir - Belgrade
sasajuric
3
480
Simplifying systems with Elixir
sasajuric
2
590
Metagrokking Elixir
sasajuric
4
320
Solid Ground
sasajuric
15
1.3k
Solid Ground
sasajuric
3
920
What's the fuss about Phoenix?
sasajuric
2
1.1k
Phoenix
sasajuric
1
250
Phoenix
sasajuric
0
150
Other Decks in Programming
See All in Programming
AIを導入する前にやるべきこと
negima
2
330
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
420
ハーネスエンジニアリングとは?
kinopeee
13
6.8k
The Less-Told Story of Socket Timeouts
coe401_
3
970
GoogleCloudとterraform完全に理解した
terisuke
1
190
t *testing.T は どこからやってくるの?
otakakot
1
900
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
120
Firefoxにコントリビューションして得られた学び
ken7253
2
150
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
140
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
240
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
340
エンジニアに許された特別な時間の終わり
watany
106
240k
Automating Front-end Workflow
addyosmani
1370
200k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
350
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
190
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Documentation Writing (for coders)
carmenintech
77
5.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
350
The Mindset for Success: Future Career Progression
greggifford
PRO
0
320
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/