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
130
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
170
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
860
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
AHC 044 混合整数計画ソルバー解法
kiri8128
0
320
Making TCPSocket.new "Happy"!
coe401_
1
120
Develop Faster With FrankenPHP
dunglas
2
3.2k
SEAL - Dive into the sea of search engines - Symfony Live Berlin 2025
alexanderschranz
1
120
エンジニア未経験が最短で戦力になるためのTips
gokana
0
260
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
13
5.7k
custom_lintで始めるチームルール管理
akaboshinit
0
200
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
250
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
860
State of Namespace
tagomoris
4
570
PHPのガベージコレクションを深掘りしよう
rinchoku
0
260
リストビュー画面UX改善の振り返り
splcywolf
0
120
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Thoughts on Productivity
jonyablonski
69
4.6k
The Language of Interfaces
destraynor
157
24k
Building Applications with DynamoDB
mza
94
6.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Done Done
chrislema
183
16k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Faster Mobile Websites
deanohume
306
31k
Become a Pro
speakerdeck
PRO
27
5.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
9
740
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/